From c7f6d072522702a505de71b3faa2ff160bde848e Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Sat, 19 Mar 2022 19:23:32 +0000 Subject: cmake: Use -Wl,-export_dynamic when building for macOS The macOS linker does not accept --export-dynamic, so use this alternate spelling. --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') 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() -- cgit v1.2.1