Skip to content

Commit 4102fea

Browse files
authored
Merge pull request #912 from al45tair/eng/PR-160759746
[Build] Enable frame pointers.
2 parents 0bb6c10 + a8b689a commit 4102fea

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ include(DispatchSanitization)
122122
include(DispatchCompilerWarnings)
123123
include(DTrace)
124124

125+
include(EnableFramePointers)
126+
125127
# NOTE(abdulras) this is the CMake supported way to control whether we generate
126128
# shared or static libraries. This impacts the behaviour of `add_library` in
127129
# what type of library it generates.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Including this file enables frame pointers, if we know how.
3+
#
4+
5+
include(CheckCompilerFlag)
6+
7+
# Check if the compiler supports -fno-omit-frame-pointer
8+
check_compiler_flag(C -fno-omit-frame-pointer SUPPORTS_NO_OMIT_FP)
9+
10+
# If it does, use it
11+
if (SUPPORTS_NO_OMIT_FP)
12+
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-fno-omit-frame-pointer>)
13+
endif()

0 commit comments

Comments
 (0)