From 1a8fd7a3820d193d1132bc4c84317348799181ff Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Sat, 19 Mar 2022 17:56:54 +0000 Subject: cmake: Only pass -Wl,--export-dynamic when linking Otherwise we get the following warnings when building .o files with Clang: clang-13: warning: -Wl,--export-dynamic: 'linker' input unused [-Wunused-command-line-argument] This is required to allow the -Werror build to pass on FreeBSD. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 66590792..2eb4b52c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -377,8 +377,8 @@ endif() if(UNIX AND NOT DBUS_DISABLE_ASSERT) # required for backtrace - string(APPEND CMAKE_C_FLAGS_DEBUG " -Wl,--export-dynamic") - string(APPEND CMAKE_CXX_FLAGS_DEBUG " -Wl,--export-dynamic") + string(APPEND CMAKE_SHARED_LINKER_FLAGS " -Wl,--export-dynamic") + string(APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,--export-dynamic") set(DBUS_BUILT_R_DYNAMIC 1) endif() -- cgit v1.2.1