Skip to content

Commit

Permalink
FIX(cmake): Ensure the client installer target is built after its dep…
Browse files Browse the repository at this point in the history
…endencies

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.
  • Loading branch information
davidebeatrici authored and Hartmnt committed Dec 9, 2024
1 parent 3aeeee9 commit dbbf106
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,6 @@ set(CMAKE_UNITY_BUILD_BATCH_SIZE 40)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ${lto})
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG OFF)

if(client OR server)
add_subdirectory(src)
endif()

if(g15 AND WIN32)
add_subdirectory("helpers/g15helper")
endif()
Expand Down Expand Up @@ -197,6 +193,10 @@ if(plugins AND client)
add_subdirectory(plugins)
endif()

if(client OR server)
add_subdirectory(src)
endif()

add_subdirectory(auxiliary_files)

if(packaging)
Expand Down
2 changes: 0 additions & 2 deletions helpers/g15helper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
3 changes: 2 additions & 1 deletion plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if(retracted-plugins)
message(STATUS "Including retracted plugins")
endif()

add_custom_target(plugins ALL)

set(AVAILABLE_PLUGINS "")

Expand Down Expand Up @@ -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()
9 changes: 9 additions & 0 deletions src/mumble/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -880,17 +880,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
Expand Down Expand Up @@ -919,6 +927,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)
Expand Down

0 comments on commit dbbf106

Please sign in to comment.