From 339878f0e765f478dc8f8bfcb44f1783da4c884f Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Wed, 19 Mar 2025 14:06:02 -0700 Subject: [PATCH 1/2] Build with -fno-omit-frame-pointer --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ed9f1e84..8def28e08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,12 @@ if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL Windows) endif() endif() +if(CMAKE_SYSTEM_NAME STREQUAL Linux) + # Pass -fno-omit-frame-pointer while compiling for better backtraces + add_compile_options("$<$:SHELL:-Xcc -fno-omit-frame-pointer>") + add_compile_options("$<$,$>:SHELL:-fno-omit-frame-pointer>") +endif() + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) From bb72e696814bae4eabfbbd2ca36f504a38a1606d Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Wed, 19 Mar 2025 14:18:20 -0700 Subject: [PATCH 2/2] Address feedback --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8def28e08..8c21d7e3c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,8 +48,9 @@ endif() if(CMAKE_SYSTEM_NAME STREQUAL Linux) # Pass -fno-omit-frame-pointer while compiling for better backtraces - add_compile_options("$<$:SHELL:-Xcc -fno-omit-frame-pointer>") - add_compile_options("$<$,$>:SHELL:-fno-omit-frame-pointer>") + add_compile_options( + "$<$:SHELL:-Xcc -fno-omit-frame-pointer>" + "$<$:-fno-omit-frame-pointer>") endif() set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)