Skip to content

Commit e6da0c2

Browse files
authored
Make MinSizeRel builds of stdlib (but not the compiler) produce debug info (#33787)
1 parent e7871c5 commit e6da0c2

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

stdlib/cmake/modules/AddSwiftStdlib.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ function(_add_target_variant_c_compile_flags)
201201
else()
202202
list(APPEND result "-g")
203203
endif()
204+
elseif("${CFLAGS_BUILD_TYPE}" STREQUAL "MinSizeRel")
205+
# MinSizeRel builds of stdlib (but not the compiler) should get debug info
206+
list(APPEND result "-g")
204207
else()
205208
list(APPEND result "-g0")
206209
endif()

stdlib/cmake/modules/SwiftSource.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ function(_add_target_variant_swift_compile_flags
246246
is_build_type_with_debuginfo("${build_type}" debuginfo)
247247
if(debuginfo)
248248
list(APPEND result "-g")
249+
elseif("${build_type}" STREQUAL "MinSizeRel")
250+
# MinSizeRel builds of stdlib (but not the compiler) should get debug info
251+
list(APPEND result "-g")
249252
endif()
250253

251254
if(enable_assertions)

0 commit comments

Comments
 (0)