File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change
1
+ include (CheckCCompilerFlag )
1
2
2
3
include (SwiftSupport )
3
4
include (DTrace )
@@ -229,11 +230,19 @@ if("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")
229
230
PRIVATE
230
231
-Xclang -fblocks )
231
232
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 ()
237
246
endif ()
238
247
if (LibRT_FOUND )
239
248
target_link_libraries (dispatch PRIVATE RT::rt )
You can’t perform that action at this time.
0 commit comments