]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
cmake: Let Wine display the correct file name and line numbers for backtraces
authorRalf Habacker <ralf.habacker@freenet.de>
Tue, 5 Feb 2019 13:46:51 +0000 (14:46 +0100)
committerRalf Habacker <ralf.habacker@freenet.de>
Sat, 16 May 2020 15:25:01 +0000 (15:25 +0000)
Wine currently only supports the symbol formats STABS and DWARF 2,
but not the other versions, with STABS providing the most information
and being the first choice.

Since we already use the cmake variable DBUS_USE_WINE for running tests
under Wine, we also use it to activate the special symbol format.

Closes dbus/dbus/#133

CMakeLists.txt

index 047cab877e7c410c2fa79d566f1bb8f290aea022..a0095ebbb55023529a91e9b5ad2a83ddcebc4e3d 100644 (file)
@@ -227,6 +227,11 @@ generate_warning_cflags(WARNINGS_CFLAGS "${WARNINGS}" "${WARNINGS_DISABLED}" "${
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNINGS_CFLAGS}")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNINGS_CFLAGS}")
 
+# let wine be able to show file and lines in backtrace
+if(DBUS_USE_WINE)
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gstabs")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gstabs")
+endif()
 
 if(UNIX AND NOT DBUS_DISABLE_ASSERT)
     # required for backtrace