From 2a8198f4d68690f5bb3dac8a4cb32029fc8c3a5b Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Thu, 28 Nov 2024 15:52:08 +0100 Subject: [PATCH 1/2] FIX(cmake): Don't set WORKING_DIRECTORY for ExternalProject_Add() This is a workaround for a bug that appeared in a recent version of CMake. WORKING_DIRECTORY prepends the specified path to a list instead of using it directly, resulting in: cd /D D:\a\1\b\overlay\overlay_xcompile-prefix;D:\a\1\b\overlay\overlay_xcompile-prefix\src\overlay_xcompile-build For reference, this causes the build to fail on Windows with the following error: "The filename, directory name, or volume label syntax is incorrect." This commit simply removes the parameter from the ExternalProject_Add() call, since the default working directory is perfectly fine. --- overlay/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/overlay/CMakeLists.txt b/overlay/CMakeLists.txt index cd4aa1f40d5..ecc5a4da2d8 100644 --- a/overlay/CMakeLists.txt +++ b/overlay/CMakeLists.txt @@ -172,7 +172,6 @@ if(64_BIT AND MSVC) "-Dversion=${PROJECT_VERSION}" ${CMAKE_SOURCE_DIR}/overlay CMAKE_GENERATOR_PLATFORM "Win32" - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/overlay/overlay_xcompile-prefix INSTALL_COMMAND "" ) else() @@ -194,7 +193,6 @@ if(64_BIT AND MSVC) "-Dsymbols=${symbols}" "-Dversion=${PROJECT_VERSION}" ${CMAKE_SOURCE_DIR}/overlay - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/overlay/overlay_xcompile-prefix INSTALL_COMMAND "" ) endif() From 2a0683d0be113b1047eeac60e1d2aa836b2eabe8 Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Fri, 29 Nov 2024 04:36:20 +0100 Subject: [PATCH 2/2] FIX(cmake): Ensure the client installer target is built after its dependencies Looks like targets are now built concurrently, which results in the installer failing to find the G15 and x64 overlay helpers. This commit marks the G15 and overlay targets as dependencies of the client, when they're enabled. As a bonus, plugins are now tied to their own dedicated target rather than the client's. This is required because the client's subdirectory is now included later on. --- CMakeLists.txt | 8 ++++---- helpers/g15helper/CMakeLists.txt | 2 -- plugins/CMakeLists.txt | 3 ++- src/mumble/CMakeLists.txt | 9 +++++++++ 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d6b4be85c3b..14485a3885e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,10 +168,6 @@ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG OFF) add_subdirectory(${3RDPARTY_DIR}/utfcpp) -if(client OR server) - add_subdirectory(src) -endif() - if(g15 AND WIN32) add_subdirectory("helpers/g15helper") endif() @@ -199,6 +195,10 @@ if(plugins AND client) add_subdirectory(plugins) endif() +if(client OR server) + add_subdirectory(src) +endif() + add_subdirectory(auxiliary_files) if(packaging) diff --git a/helpers/g15helper/CMakeLists.txt b/helpers/g15helper/CMakeLists.txt index 22292c6aa3d..cc68fd3b525 100644 --- a/helpers/g15helper/CMakeLists.txt +++ b/helpers/g15helper/CMakeLists.txt @@ -12,8 +12,6 @@ set(G15HELPER_PLIST "${CMAKE_BINARY_DIR}/g15helper.plist") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/g15helper.plist.in" "${G15HELPER_PLIST}") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/g15helper.rc.in" "${G15HELPER_RC}") -get_target_property(MUMBLE_SOURCE_DIR mumble SOURCE_DIR) - add_executable(g15-helper WIN32 "${CMAKE_SOURCE_DIR}/auxiliary_files/mumble.appcompat.manifest" "${G15HELPER_RC}" diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 1faefad9828..1fece7c7834 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -9,6 +9,7 @@ if(retracted-plugins) message(STATUS "Including retracted plugins") endif() +add_custom_target(plugins ALL) set(AVAILABLE_PLUGINS "") @@ -123,5 +124,5 @@ foreach(CURRENT_PLUGIN IN LISTS AVAILABLE_PLUGINS) install(TARGETS ${CURRENT_PLUGIN} LIBRARY DESTINATION "${MUMBLE_INSTALL_PLUGINDIR}" COMPONENT mumble_client) endif() - add_dependencies(mumble ${CURRENT_PLUGIN}) + add_dependencies(plugins ${CURRENT_PLUGIN}) endforeach() diff --git a/src/mumble/CMakeLists.txt b/src/mumble/CMakeLists.txt index 7476917bb5b..4cc9fa84d9e 100644 --- a/src/mumble/CMakeLists.txt +++ b/src/mumble/CMakeLists.txt @@ -887,17 +887,25 @@ if(overlay) "Overlay_win.cpp" "Overlay_win.h" ) + + add_dependencies(mumble overlay) else() if(APPLE) target_sources(mumble_client_object_lib PRIVATE "Overlay_macx.mm") else() target_sources(mumble_client_object_lib PRIVATE "Overlay_unix.cpp") endif() + + add_dependencies(mumble overlay_gl) endif() target_compile_definitions(mumble_client_object_lib PUBLIC "USE_OVERLAY") endif() +if(plugins) + add_dependencies(mumble plugins) +endif() + if(xboxinput) target_sources(mumble_client_object_lib PRIVATE @@ -926,6 +934,7 @@ if(g15) "G15LCDEngine_helper.h" ) target_include_directories(mumble_client_object_lib PUBLIC "${CMAKE_SOURCE_DIR}/helpers") + add_dependencies(mumble g15-helper) else() find_library(LIB_G15DAEMON_CLIENT "g15daemon_client") if(LIB_G15DAEMON_CLIENT-NOTFOUND)