Skip to content

Commit 9469e72

Browse files
committed
Address TODO to unblock master-next.
1 parent f911a44 commit 9469e72

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/CMakeLists.txt

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include(CheckCCompilerFlag)
12

23
include(SwiftSupport)
34
include(DTrace)
@@ -229,11 +230,19 @@ if("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")
229230
PRIVATE
230231
-Xclang -fblocks)
231232
else()
232-
# FIXME(compnerd) add check for -momit-leaf-frame-pointer?
233-
target_compile_options(dispatch
234-
PRIVATE
235-
-fblocks
236-
-momit-leaf-frame-pointer)
233+
check_c_compiler_flag("-momit-leaf-frame-pointer -Werror -Wall -O3" C_SUPPORTS_OMIT_LEAF_FRAME_POINTER)
234+
if (C_SUPPORTS_OMIT_LEAF_FRAME_POINTER)
235+
target_compile_options(dispatch
236+
PRIVATE
237+
-fblocks
238+
-momit-leaf-frame-pointer
239+
)
240+
else()
241+
target_compile_options(dispatch
242+
PRIVATE
243+
-fblocks
244+
)
245+
endif()
237246
endif()
238247
if(LibRT_FOUND)
239248
target_link_libraries(dispatch PRIVATE RT::rt)

0 commit comments

Comments
 (0)