From: Gleb Popov <6yearold@gmail.com> Date: Mon, 19 May 2025 07:15:20 +0000 (+0300) Subject: Fix building with asserts enabled in FreeBSD X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2bf407f5bb5200c399c37a5fd1d42d273e9a7712;p=thirdparty%2Fdbus.git Fix building with asserts enabled in FreeBSD The backtrace() function on FreeBSD resides in the libexecinfo library, so we need to link to it. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index acda97525..c6aa0a087 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/dbus/meson.build b/dbus/meson.build index d2acd0594..4c9f7be17 100644 --- a/dbus/meson.build +++ b/dbus/meson.build @@ -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 = [