From bd1209153fc0295bdc794078594625cd67bd53a9 Mon Sep 17 00:00:00 2001 From: Carlo Castoldi Date: Fri, 18 Nov 2022 12:44:02 +0100 Subject: [PATCH] BUILD(overlay): build overlay on Linux and FreeBSD without client flag --- CMakeLists.txt | 10 ++- auxiliary_files/CMakeLists.txt | 71 ++++++++++---------- docs/dev/build-instructions/cmake_options.md | 2 +- src/CMakeLists.txt | 3 - 4 files changed, 42 insertions(+), 44 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b69a987dcc..7632707d150 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,8 +76,10 @@ option(static "Build static binaries." OFF) option(symbols "Build binaries in a way that allows easier debugging." OFF) option(warnings-as-errors "All warnings are treated as errors." ON) +option(client "Build the client (Mumble)" ON) +option(server "Build the server (Murmur)" ON) if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") - option(overlay "Build overlay." ON) + option(overlay "Build overlay." ${client}) endif() option(packaging "Build package." OFF) option(tests "Build tests." ${packaging}) @@ -161,7 +163,9 @@ add_compile_definitions(MUMBLE_TARGET_OS="${MUMBLE_TARGET_OS}") set(CMAKE_UNITY_BUILD_BATCH_SIZE 40) -add_subdirectory(src) +if(client OR server) + add_subdirectory(src) +endif() if(g15 AND WIN32) add_subdirectory("helpers/g15helper") @@ -174,7 +178,7 @@ if(APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm64") message(STATUS "Disabling the overlay on ARM macOS") endif() -if(overlay AND client) +if(overlay) if(WIN32) add_subdirectory(overlay) else() diff --git a/auxiliary_files/CMakeLists.txt b/auxiliary_files/CMakeLists.txt index 1eb3121c433..b62eb064360 100644 --- a/auxiliary_files/CMakeLists.txt +++ b/auxiliary_files/CMakeLists.txt @@ -11,55 +11,52 @@ if(NOT BUILD_RELEASE_DATE) string(TIMESTAMP BUILD_RELEASE_DATE "%Y-%m-%d") endif() -if(client) - if(UNIX AND NOT APPLE) +if(overlay) + if(UNIX) delayed_configure_files( - TARGET mumble + TARGET overlay_gl FILES - "${CMAKE_CURRENT_SOURCE_DIR}/config_files/info.mumble.Mumble.appdata.xml.in=${CMAKE_CURRENT_BINARY_DIR}/info.mumble.Mumble.appdata.xml" - "${CMAKE_CURRENT_SOURCE_DIR}/config_files/info.mumble.Mumble.desktop.in=${CMAKE_CURRENT_BINARY_DIR}/info.mumble.Mumble.desktop" + "${CMAKE_CURRENT_SOURCE_DIR}/run_scripts/mumble-overlay.in=${CMAKE_CURRENT_BINARY_DIR}/mumble-overlay" PASSTHROUGH_VARIABLES MUMBLE_BUILD_YEAR - CMAKE_PROJECT_VERSION - BUILD_RELEASE_DATE - CMAKE_PROJECT_HOMEPAGE_URL - CMAKE_PROJECT_DESCRIPTION + MUMBLE_INSTALL_ABS_LIBDIR VARIABLES - "MUMBLE_CLIENT_BINARY_NAME=$" + "MUMBLE_OVERLAY_BINARY_BASENAME=$" PYTHON_INTERPRETER "${PYTHON_INTERPRETER}" @ONLY ) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/info.mumble.Mumble.appdata.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo") - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/info.mumble.Mumble.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications") - - # Install Mumble client man files - install(FILES "man_files/mumble.1" DESTINATION "${MUMBLE_INSTALL_MANDIR}" COMPONENT doc) + # install overlay script + install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/mumble-overlay" DESTINATION "${MUMBLE_INSTALL_SCRIPTDIR}") + # install overlay man-files + install(FILES "man_files/mumble-overlay.1" DESTINATION "${MUMBLE_INSTALL_MANDIR}" COMPONENT doc) endif() +endif() - if(overlay) - if(UNIX) - delayed_configure_files( - TARGET overlay_gl - FILES - "${CMAKE_CURRENT_SOURCE_DIR}/run_scripts/mumble-overlay.in=${CMAKE_CURRENT_BINARY_DIR}/mumble-overlay" - PASSTHROUGH_VARIABLES - MUMBLE_BUILD_YEAR - MUMBLE_INSTALL_ABS_LIBDIR - VARIABLES - "MUMBLE_OVERLAY_BINARY_BASENAME=$" - PYTHON_INTERPRETER "${PYTHON_INTERPRETER}" - @ONLY - ) - - # install overlay script - install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/mumble-overlay" DESTINATION "${MUMBLE_INSTALL_SCRIPTDIR}") - - # install overlay man-files - install(FILES "man_files/mumble-overlay.1" DESTINATION "${MUMBLE_INSTALL_MANDIR}" COMPONENT doc) - endif() - endif() +if(client AND UNIX AND NOT APPLE) + delayed_configure_files( + TARGET mumble + FILES + "${CMAKE_CURRENT_SOURCE_DIR}/config_files/info.mumble.Mumble.appdata.xml.in=${CMAKE_CURRENT_BINARY_DIR}/info.mumble.Mumble.appdata.xml" + "${CMAKE_CURRENT_SOURCE_DIR}/config_files/info.mumble.Mumble.desktop.in=${CMAKE_CURRENT_BINARY_DIR}/info.mumble.Mumble.desktop" + PASSTHROUGH_VARIABLES + MUMBLE_BUILD_YEAR + CMAKE_PROJECT_VERSION + BUILD_RELEASE_DATE + CMAKE_PROJECT_HOMEPAGE_URL + CMAKE_PROJECT_DESCRIPTION + VARIABLES + "MUMBLE_CLIENT_BINARY_NAME=$" + PYTHON_INTERPRETER "${PYTHON_INTERPRETER}" + @ONLY + ) + + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/info.mumble.Mumble.appdata.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo") + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/info.mumble.Mumble.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications") + + # Install Mumble client man files + install(FILES "man_files/mumble.1" DESTINATION "${MUMBLE_INSTALL_MANDIR}" COMPONENT doc) endif() if(server) diff --git a/docs/dev/build-instructions/cmake_options.md b/docs/dev/build-instructions/cmake_options.md index f4f16531434..30a1abd0994 100644 --- a/docs/dev/build-instructions/cmake_options.md +++ b/docs/dev/build-instructions/cmake_options.md @@ -152,7 +152,7 @@ Build support for OSS. ### overlay Build overlay. -(Default: ON) +(Default: ${client}) ### overlay-xcompile diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e7313348366..13b3d30433f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,9 +6,6 @@ set(PROTO_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Mumble.proto") set(UDP_PROTO_FILE "${CMAKE_CURRENT_SOURCE_DIR}/MumbleUDP.proto") -option(client "Build the client (Mumble)" ON) -option(server "Build the server (Murmur)" ON) - option(benchmarks "Build benchmarks" OFF) option(qssldiffiehellmanparameters "Build support for custom Diffie-Hellman parameters." ON)