summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAlex Richardson <arichardson.kde@gmail.com>2022-03-19 19:23:32 +0000
committerRalf Habacker <ralf.habacker@freenet.de>2022-03-24 22:00:06 +0000
commitc7f6d072522702a505de71b3faa2ff160bde848e (patch)
tree63398ef3e0ee29cd584d26a3992d66e4a6135a08 /CMakeLists.txt
parent1a8fd7a3820d193d1132bc4c84317348799181ff (diff)
downloaddbus-c7f6d072522702a505de71b3faa2ff160bde848e.tar.gz
cmake: Use -Wl,-export_dynamic when building for macOS
The macOS linker does not accept --export-dynamic, so use this alternate spelling.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 7 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2eb4b52c..ae9700db 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -377,8 +377,13 @@ endif()
if(UNIX AND NOT DBUS_DISABLE_ASSERT)
# required for backtrace
- string(APPEND CMAKE_SHARED_LINKER_FLAGS " -Wl,--export-dynamic")
- string(APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,--export-dynamic")
+ if (APPLE)
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS " -Wl,-export_dynamic")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,-export_dynamic")
+ else()
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS " -Wl,--export-dynamic")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,--export-dynamic")
+ endif()
set(DBUS_BUILT_R_DYNAMIC 1)
endif()