Skip to content

Commit 354a762

Browse files
committed
cmake: pass -fdebug-prefix-map so that debug entries contain relative source locations
1 parent 53ee9ae commit 354a762

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cdk/cmake/compiler/GCC.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@
2828

2929
##########################################################################
3030

31+
#
32+
# Ensure relative source locations in debug entries
33+
#
34+
35+
foreach(LANG C CXX)
36+
foreach(TYPE DEBUG RELWITHDEBINFO)
37+
set(CMAKE_${LANG}_FLAGS_${TYPE}
38+
"-fdebug-prefix-map=${CMAKE_SOURCE_DIR}=. ${CMAKE_${LANG}_FLAGS_${TYPE}}"
39+
)
40+
endforeach(TYPE)
41+
endforeach(LANG)
42+
3143
#
3244
# Deal with broken optimization in gcc 4.8.
3345
#

0 commit comments

Comments
 (0)