From 2a0683d0be113b1047eeac60e1d2aa836b2eabe8 Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Fri, 29 Nov 2024 04:36:20 +0100 Subject: [PATCH] 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)