Skip to content

Commit 4ce93ac

Browse files
authored
Build with -fno-omit-frame-pointer on Linux (#1220)
* Build with -fno-omit-frame-pointer * Address feedback
1 parent bb837e1 commit 4ce93ac

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

CMakeLists.txt

+7
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
4646
endif()
4747
endif()
4848

49+
if(CMAKE_SYSTEM_NAME STREQUAL Linux)
50+
# Pass -fno-omit-frame-pointer while compiling for better backtraces
51+
add_compile_options(
52+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xcc -fno-omit-frame-pointer>"
53+
"$<$<COMPILE_LANGUAGE:C,CXX>:-fno-omit-frame-pointer>")
54+
endif()
55+
4956
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
5057
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
5158
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

0 commit comments

Comments
 (0)