Skip to content

Commit a8b689a

Browse files
committed
[Build] Enable frame pointers.
Frame pointers should be enabled everywhere. rdar://160759746
1 parent 4c271c4 commit a8b689a

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
@@ -118,6 +118,8 @@ include(DispatchSanitization)
118118
include(DispatchCompilerWarnings)
119119
include(DTrace)
120120

121+
include(EnableFramePointers)
122+
121123
# NOTE(abdulras) this is the CMake supported way to control whether we generate
122124
# shared or static libraries. This impacts the behaviour of `add_library` in
123125
# 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)