fixed backtrace printing on unix with cmake build system
authorRalf Habacker <ralf.habacker@freenet.de>
Mon, 8 Mar 2010 14:55:46 +0000 (15:55 +0100)
committerRalf Habacker <ralf.habacker@freenet.de>
Mon, 8 Mar 2010 14:55:46 +0000 (15:55 +0100)
cmake/CMakeLists.txt

index 1333d9d93c1737e25b6b2ba56c3f700901228295..e4a9c00120242b96875f5100fe32b7216d74fbab 100644 (file)
@@ -49,6 +49,9 @@ if(NOT WIN32)
        OPTION(DBUS_ENABLE_ABSTRACT_SOCKETS "enable support for abstract sockets" ON)
 endif(NOT WIN32)
 
+#AC_ARG_ENABLE(asserts, AS_HELP_STRING([--enable-asserts],[include assertion checks]),enable_asserts=$enableval,enable_asserts=$USE_MAINTAINER_MODE)
+OPTION(DBUS_DISABLE_ASSERTS "Disable assertion checking" OFF)
+
 # do config checks
 INCLUDE(ConfigureChecks.cmake)
 
@@ -103,6 +106,13 @@ if(WIN32)
        endif(MSVC)
 endif(WIN32)
 
+if (UNIX AND NOT DBUS_DISABLE_ASSERTS)
+       # required for backtrace
+       SET(CMAKE_C_FLAGS_DEBUG   "${CMAKE_C_FLAGS_DEBUG}   -Wl,--export-dynamic")
+       SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wl,--export-dynamic")
+       add_definitions(-DDBUS_BUILT_R_DYNAMIC)
+endif (UNIX AND NOT DBUS_DISABLE_ASSERTS)
+
 SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}  -D_DEBUG")
 
 #########################################################################
@@ -245,9 +255,6 @@ endif(DBUS_ENABLE_ANSI)
 #AC_ARG_ENABLE(verbose-mode, AS_HELP_STRING([--enable-verbose-mode],[support verbose debug mode]),enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE)
 OPTION(DBUS_ENABLE_VERBOSE_MODE "support verbose debug mode" ON)
 
-#AC_ARG_ENABLE(asserts, AS_HELP_STRING([--enable-asserts],[include assertion checks]),enable_asserts=$enableval,enable_asserts=$USE_MAINTAINER_MODE)
-OPTION(DBUS_DISABLE_ASSERTS "Disable assertion checking" OFF)
-
 #AC_ARG_ENABLE(checks, AS_HELP_STRING([--enable-checks],[include sanity checks on public API]),enable_checks=$enableval,enable_checks=yes)
 OPTION(DBUS_DISABLE_CHECKS "Disable public API sanity checking" OFF)