Skip to content

Commit 15022ff

Browse files
authored
Pass -fno-omit-frame-pointer on Linux (#5191)
1 parent 4a9694d commit 15022ff

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ add_compile_definitions(
124124
if(CMAKE_SYSTEM_NAME STREQUAL Linux)
125125
check_symbol_exists(sched_getaffinity "sched.h" HAVE_SCHED_GETAFFINITY)
126126
add_compile_definitions($<$<COMPILE_LANGUAGE:C>:HAVE_SCHED_GETAFFINITY>)
127+
128+
# Pass -fno-omit-frame-pointer while compiling for better backtraces
129+
add_compile_options(
130+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xcc -fno-omit-frame-pointer>"
131+
"$<$<COMPILE_LANGUAGE:C,CXX>:-fno-omit-frame-pointer>")
127132
endif()
128133

129134
# Precompute module triple for installation

0 commit comments

Comments
 (0)