[cmake] use relative paths for debug symbols
When not building a Debug configuration use relative paths for __FILE__ et al in the debug symbol entries
This commit is contained in:
parent
780f6dddce
commit
af7849b579
@ -64,10 +64,14 @@ endif()
|
||||
|
||||
CheckCXXFlag(-fno-omit-frame-pointer)
|
||||
|
||||
CheckCXXFlag(-fmacro-prefix-map="${CMAKE_SOURCE_DIR}"="./")
|
||||
CheckCXXFlag(-fmacro-prefix-map="${CMAKE_BINARY_DIR}"="./build/")
|
||||
CheckCXXFlag(-ffile-prefix-map="${CMAKE_SOURCE_DIR}"="./")
|
||||
CheckCXXFlag(-ffile-prefix-map="${CMAKE_BINARY_DIR}"="./build")
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
add_compile_options($<$<NOT:$<CONFIG:Debug>>:-fdebug-prefix-map=${CMAKE_SOURCE_DIR}=.>)
|
||||
add_compile_options($<$<NOT:$<CONFIG:Debug>>:-fmacro-prefix-map=${CMAKE_SOURCE_DIR}=.>)
|
||||
add_compile_options($<$<NOT:$<CONFIG:Debug>>:-ffile-prefix-map=${CMAKE_SOURCE_DIR}=.>)
|
||||
add_compile_options($<$<NOT:$<CONFIG:Debug>>:-fdebug-prefix-map=${CMAKE_BINARY_DIR}=./build>)
|
||||
add_compile_options($<$<NOT:$<CONFIG:Debug>>:-fmacro-prefix-map=${CMAKE_BINARY_DIR}=./build>)
|
||||
add_compile_options($<$<NOT:$<CONFIG:Debug>>:-ffile-prefix-map=${CMAKE_BINARY_DIR}=./build>)
|
||||
endif()
|
||||
|
||||
# https://stackoverflow.com/questions/4913922/possible-problems-with-nominmax-on-visual-c
|
||||
if (WIN32)
|
||||
|
@ -64,10 +64,14 @@ endif()
|
||||
|
||||
CheckCFlag(-fno-omit-frame-pointer)
|
||||
|
||||
CheckCFlag(-fmacro-prefix-map="${CMAKE_SOURCE_DIR}"="./")
|
||||
CheckCFlag(-fmacro-prefix-map="${CMAKE_BINARY_DIR}"="./build/")
|
||||
CheckCFlag(-ffile-prefix-map="${CMAKE_SOURCE_DIR}"="./")
|
||||
CheckCFlag(-ffile-prefix-map="${CMAKE_BINARY_DIR}"="./build")
|
||||
if (CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "GNU")
|
||||
add_compile_options($<$<NOT:$<CONFIG:Debug>>:-fdebug-prefix-map=${CMAKE_SOURCE_DIR}=.>)
|
||||
add_compile_options($<$<NOT:$<CONFIG:Debug>>:-fmacro-prefix-map=${CMAKE_SOURCE_DIR}=.>)
|
||||
add_compile_options($<$<NOT:$<CONFIG:Debug>>:-ffile-prefix-map=${CMAKE_SOURCE_DIR}=.>)
|
||||
add_compile_options($<$<NOT:$<CONFIG:Debug>>:-fdebug-prefix-map=${CMAKE_BINARY_DIR}=./build>)
|
||||
add_compile_options($<$<NOT:$<CONFIG:Debug>>:-fmacro-prefix-map=${CMAKE_BINARY_DIR}=./build>)
|
||||
add_compile_options($<$<NOT:$<CONFIG:Debug>>:-ffile-prefix-map=${CMAKE_BINARY_DIR}=./build>)
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "default CFLAGS")
|
||||
message("Using CFLAGS ${CMAKE_C_FLAGS}")
|
||||
|
Loading…
Reference in New Issue
Block a user