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.
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()