File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -183,12 +183,16 @@ function(_add_variant_c_compile_flags)
183
183
if (optimized OR CFLAGS_FORCE_BUILD_OPTIMIZED )
184
184
list (APPEND result "-O2" )
185
185
186
- # Omit leaf frame pointers on x86.
187
- if ("${CFLAGS_ARCH} " STREQUAL "i386" OR "${CFLAGS_ARCH} " STREQUAL "i686" )
188
- if (NOT SWIFT_COMPILER_IS_MSVC_LIKE )
189
- list (APPEND result "-momit-leaf-frame-pointer" )
190
- else ()
191
- list (APPEND result "/Oy" )
186
+ # Omit leaf frame pointers on x86 production builds (optimized, no debug
187
+ # info, and no asserts).
188
+ is_build_type_with_debuginfo ("${CFLAGS_BUILD_TYPE} " debug )
189
+ if (NOT debug AND NOT CFLAGS_ENABLE_ASSERTIONS )
190
+ if ("${CFLAGS_ARCH} " STREQUAL "i386" OR "${CFLAGS_ARCH} " STREQUAL "i686" )
191
+ if (NOT SWIFT_COMPILER_IS_MSVC_LIKE )
192
+ list (APPEND result "-momit-leaf-frame-pointer" )
193
+ else ()
194
+ list (APPEND result "/Oy" )
195
+ endif ()
192
196
endif ()
193
197
endif ()
194
198
else ()
You can’t perform that action at this time.
0 commit comments