diff options
author | Robert Adam <dev@robert-adam.de> | 2021-06-13 21:13:03 +0300 |
---|---|---|
committer | Robert Adam <dev@robert-adam.de> | 2021-06-15 09:10:06 +0300 |
commit | 86e6d2c6045ae958301904f46bc0435e641de45c (patch) | |
tree | 82829ffe75a515ee08012b25cfb07fbf476b3466 /CMakeLists.txt | |
parent | ff947a60f0f431fda97e5ef5303afbe89a0476f8 (diff) |
FIX(client): Ambiguity in plugin installer
Previously the plugin installer attempted to select the correct plugin
binary by its file extension but it turns out that this is not a unique
choice (e.g. .so is supported on macOS and on Linux).
Therefore this commit introduces a mandatory manifest file that is to be
present in plugin bundles that contains the mapping for which binary to
use on which OS and for which architecture.
Because a plugin bundle now has to follow such a strict format, it is
now also mandatory for the bundle to have the file extension
.mumble_plugin (previously .zip was allowed as well).
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 448e8b905..8ee589687 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,7 @@ list(APPEND CMAKE_MODULE_PATH include(pkg-utils) include(project-utils) +include(TargetArch) option(tests "Build tests" OFF) @@ -74,16 +75,13 @@ endif() include(compiler) include(os) -if (64_BIT) - set(ARCH "x64") -else() - set(ARCH "x86") -endif() +target_architecture(MUMBLE_TARGET_ARCH) +string(TOLOWER "${MUMBLE_TARGET_ARCH}" MUMBLE_TARGET_ARCH) message(STATUS "##################################################") message(STATUS "Mumble release ID: ${RELEASE_ID}") message(STATUS "Mumble version: ${PROJECT_VERSION}") -message(STATUS "Architecture: ${ARCH}") +message(STATUS "Architecture: ${MUMBLE_TARGET_ARCH}") if(NOT IS_MULTI_CONFIG) message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") else() @@ -109,6 +107,16 @@ if(tests) include(CTest) endif() +if (WIN32) + set(MUMBLE_TARGET_OS "windows") +elseif (APPLE) + set(MUMBLE_TARGET_OS "macos") +elseif (UNIX) + set(MUMBLE_TARGET_OS "linux") +else() + message(FATAL_ERROR "Unable to determine target OS") +endif() + # Make the build year accessible as a macro add_compile_definitions(MUMBLE_BUILD_YEAR=${MUMBLE_BUILD_YEAR}) @@ -116,6 +124,14 @@ add_compile_definitions(MUMBLE_BUILD_YEAR=${MUMBLE_BUILD_YEAR}) # Make sure that math constants are always defined add_compile_definitions(_USE_MATH_DEFINES) + +# Provide the information about the target architecture to all Mumble source files in form of a macro +add_compile_definitions(MUMBLE_TARGET_ARCH="${MUMBLE_TARGET_ARCH}") + +# Also provide information about the target OS +add_compile_definitions(MUMBLE_TARGET_OS="${MUMBLE_TARGET_OS}") + + set(CMAKE_UNITY_BUILD_BATCH_SIZE 40) add_subdirectory(src) |