diff options
author | Robert Adam <dev@robert-adam.de> | 2021-03-09 14:49:03 +0300 |
---|---|---|
committer | Robert Adam <dev@robert-adam.de> | 2021-03-09 14:49:03 +0300 |
commit | 3626d1bd298597efc7a36de71d7ce87847733e37 (patch) | |
tree | 8c3b4c45a67b29a1df13c14d8f08d7fb5cb67819 | |
parent | 988422d0e6585159dfb0bb8a8639ba20d13c5fe2 (diff) |
BUILD(cmake): Fix unity build issue
On Unix there are the X11 headers that define incredibly many macros of
which basically none are prefixed in any way. Thus these can easily lead
to name clashes in other files if unity builds are active.
Thus the files known to make problems, are excluded from unity builds in
order to avoid that.
-rw-r--r-- | src/mumble/CMakeLists.txt | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/src/mumble/CMakeLists.txt b/src/mumble/CMakeLists.txt index 18f861cfd..2186e0358 100644 --- a/src/mumble/CMakeLists.txt +++ b/src/mumble/CMakeLists.txt @@ -990,17 +990,27 @@ if(wasapi) endif() endif() -if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0" AND APPLE) - # Prevent objective C files from being included in unity builds as that causes issues - set_source_files_properties( - "AppNap.mm" - "GlobalShortcut_macx.mm" - "Log_macx.mm" - "os_macx.mm" - "TextToSpeech_macx.mm" - "Overlay_macx.mm" - "CoreAudio.mm" - PROPERTIES - SKIP_UNITY_BUILD_INCLUSION TRUE - ) +if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0") + if (APPLE) + # Prevent objective C files from being included in unity builds as that causes issues + set_source_files_properties( + "AppNap.mm" + "GlobalShortcut_macx.mm" + "Log_macx.mm" + "os_macx.mm" + "TextToSpeech_macx.mm" + "Overlay_macx.mm" + "CoreAudio.mm" + PROPERTIES + SKIP_UNITY_BUILD_INCLUSION TRUE + ) + elseif(UNIX) + # Exclude source files that include the X11 headers as these define + # an awful lot of macros that can conflict with other code + set_source_files_properties( + "GlobalShortcut_unix.cpp" + PROPERTIES + SKIP_UNITY_BUILD_INCLUSION TRUE + ) + endif() endif() |