File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed
cmake/caches/Vendors/Apple Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -12,3 +12,7 @@ set(SwiftCore_ENABLE_VECTOR_TYPES ON CACHE BOOL "")
1212set (SwiftCore_ENABLE_RUNTIME_FUNCTION_COUNTERS ON CACHE BOOL "" )
1313set (SwiftCore_ENABLE_BACKDEPLOYMENT_SUPPORT ON CACHE BOOL "" )
1414set (SwiftCore_ENABLE_FILESYSTEM_SUPPORT ON CACHE BOOL "" )
15+
16+ set (CMAKE_CXX_FLAGS_MINSIZEREL "-Os -g -DNDEBUG" CACHE STRING "" )
17+ set (CMAKE_C_FLAGS_MINSIZEREL "-Os -g -DNDEBUG" CACHE STRING "" )
18+ set (CMAKE_Swift_FLAGS_MINSIZEREL "-Osize -g" CACHE STRING "" )
Original file line number Diff line number Diff line change @@ -8,5 +8,6 @@ set(CMAKE_Swift_COMPILER_TARGET "arm64-apple-bridgeos${CMAKE_OSX_DEPLOYMENT_TARG
88
99set (SwiftCore_ARCH_SUBDIR arm64)
1010set (SwiftCore_PLATFORM_SUBDIR freestanding)
11+ set (CMAKE_BUILD_TYPE MinSizeRel CACHE STRING "" )
1112
1213include ("${CMAKE_CURRENT_LIST_DIR} /apple-common.cmake" )
Original file line number Diff line number Diff line change @@ -283,9 +283,14 @@ target_compile_options(swiftCore PRIVATE
283283 "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolinking-runtime-compatibility-concurrency>"
284284 "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-objc-attr-requires-foundation-module>"
285285 "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -require-explicit-availability=ignore>"
286- "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -prespecialize-generic-metadata>"
287- "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xllvm -sil-inline-generics>"
288- "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xllvm -sil-partial-specialization>" )
286+ "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -prespecialize-generic-metadata>" )
287+
288+ if (NOT "${CMAKE_BUILD_TYPE} " STREQUAL "MinSizeRel" )
289+ # Using these in MinSizeRel would result in a 15% increase in the binary size
290+ target_compile_options (swiftCore PRIVATE
291+ "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xllvm -sil-inline-generics>"
292+ "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xllvm -sil-partial-specialization>" )
293+ endif ()
289294
290295target_compile_definitions (swiftCore PRIVATE
291296 $<$<BOOL :${SwiftCore_ENABLE_REFLECTION} >:-DSWIFT_ENABLE_REFLECTION>
You can’t perform that action at this time.
0 commit comments