Skip to content

Commit 7e1ca94

Browse files
ShaurenKrigsgaldrnet
authored andcommitted
Build: Enable debug format flag -ggdb3 instead of -g by default for debug builds
(cherry picked from commit 2b38f40988d0e0fab5b86ba82812e79681c77363)
1 parent 924fb5c commit 7e1ca94

2 files changed

Lines changed: 6 additions & 14 deletions

File tree

cmake/compiler/clang/settings.cmake

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,9 @@ if(WITH_WARNINGS)
5555
message(STATUS "Clang: All warnings enabled")
5656
endif()
5757

58-
if(WITH_COREDEBUG)
59-
target_compile_options(trinity-compile-option-interface
60-
INTERFACE
61-
-g3)
62-
63-
message(STATUS "Clang: Debug-flags set (-g3)")
64-
endif()
58+
target_compile_options(trinity-compile-option-interface
59+
INTERFACE
60+
$<$<OR:$<CONFIG:Debug,RelWithDebInfo>,$<BOOL:${WITH_COREDEBUG}>>:-g3 -glldb>)
6561

6662
if(ASAN)
6763
target_compile_options(trinity-compile-option-interface

cmake/compiler/gcc/settings.cmake

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,9 @@ if(WITH_WARNINGS)
4141
message(STATUS "GCC: All warnings enabled")
4242
endif()
4343

44-
if(WITH_COREDEBUG)
45-
target_compile_options(trinity-compile-option-interface
46-
INTERFACE
47-
-g3)
48-
49-
message(STATUS "GCC: Debug-flags set (-g3)")
50-
endif()
44+
target_compile_options(trinity-compile-option-interface
45+
INTERFACE
46+
$<$<OR:$<CONFIG:Debug,RelWithDebInfo>,$<BOOL:${WITH_COREDEBUG}>>:-ggdb3>)
5147

5248
if(ASAN)
5349
target_compile_options(trinity-compile-option-interface

0 commit comments

Comments
 (0)