Merge branch 'asserts' into 'main'

Fix building with asserts enabled in FreeBSD

See merge request dbus/dbus!527
This commit is contained in:
Simon McVittie 2025-05-22 10:16:19 +00:00
commit 0e8331151d
2 changed files with 9 additions and 0 deletions

View file

@ -372,6 +372,10 @@ if(UNIX AND NOT DBUS_DISABLE_ASSERT)
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -Wl,--export-dynamic")
string(APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,--export-dynamic")
endif()
if (CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -lexecinfo")
string(APPEND CMAKE_EXE_LINKER_FLAGS " -lexecinfo")
endif()
set(DBUS_BUILT_R_DYNAMIC 1)
endif()

View file

@ -27,6 +27,11 @@ dbus_dependencies = [
valgrind.partial_dependency(compile_args: true),
]
if asserts and host_machine.system() == 'freebsd'
execinfo_dep = declare_dependency(link_args: '-lexecinfo')
dbus_dependencies += execinfo_dep
endif
# source code that goes in the installed client library
# and is specific to library functionality
dbus_lib_sources = [