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 "")
12
12
set (SwiftCore_ENABLE_RUNTIME_FUNCTION_COUNTERS ON CACHE BOOL "" )
13
13
set (SwiftCore_ENABLE_BACKDEPLOYMENT_SUPPORT ON CACHE BOOL "" )
14
14
set (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
8
8
9
9
set (SwiftCore_ARCH_SUBDIR arm64 )
10
10
set (SwiftCore_PLATFORM_SUBDIR freestanding )
11
+ set (CMAKE_BUILD_TYPE MinSizeRel CACHE STRING "" )
11
12
12
13
include ("${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
283
283
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolinking-runtime-compatibility-concurrency>"
284
284
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-objc-attr-requires-foundation-module>"
285
285
"$<$<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 ()
289
294
290
295
target_compile_definitions (swiftCore PRIVATE
291
296
$< $< BOOL:${SwiftCore_ENABLE_REFLECTION} > :-DSWIFT_ENABLE_REFLECTION>
You can’t perform that action at this time.
0 commit comments