Skip to content

Commit 03a8ad1

Browse files
al45tairweissi
authored andcommitted
[Build] Enable frame pointers.
Frame pointers should be enabled everywhere. rdar://160759746 (cherry picked from commit a8b689a)
1 parent a3f791a commit 03a8ad1

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
@@ -126,6 +126,8 @@ include(DispatchCompilerWarnings)
126126
include(DTrace)
127127
include(SwiftSupport)
128128

129+
include(EnableFramePointers)
130+
129131
# NOTE(abdulras) this is the CMake supported way to control whether we generate
130132
# shared or static libraries. This impacts the behaviour of `add_library` in
131133
# 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)