Skip to content

Commit 748099c

Browse files
authored
Merge pull request #40426 from kubamracek/promote-cmake-options
Promote some stdlib/swift CMake flags into build-script settings
2 parents 927d694 + d531d9e commit 748099c

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

utils/build-presets.ini

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2518,6 +2518,8 @@ build-swift-dynamic-sdk-overlay=0
25182518
build-swift-dynamic-stdlib=0
25192519
build-swift-static-stdlib=1
25202520
swift-objc-interop=0
2521+
swift-enable-dispatch=0
2522+
swift-implicit-concurrency-import=0
25212523
swift-enable-compatibility-overrides=0
25222524
swift-enable-reflection=0
25232525
swift-stdlib-stable-abi=0
@@ -2532,13 +2534,10 @@ swift-stdlib-single-threaded-runtime=1
25322534
swift-stdlib-os-versioning=0
25332535
swift-stdlib-has-commandline=0
25342536
swift-stdlib-lto=full
2535-
extra-cmake-options=
2536-
-DSWIFT_ENABLE_DISPATCH:BOOL=FALSE
2537-
-DSWIFT_IMPLICIT_CONCURRENCY_IMPORT:BOOL=FALSE
2538-
-DSWIFT_STDLIB_ENABLE_PRESPECIALIZATION:BOOL=FALSE
2539-
-DSWIFT_STDLIB_PASSTHROUGH_METADATA_ALLOCATOR:BOOL=TRUE
2540-
-DSWIFT_STDLIB_SHORT_MANGLING_LOOKUPS:BOOL=FALSE
2541-
-DSWIFT_STDLIB_EXPERIMENTAL_HERMETIC_SEAL_AT_LINK:BOOL=TRUE
2537+
swift-stdlib-enable-prespecialization=0
2538+
swift-stdlib-passthrough-metadata-allocator=1
2539+
swift-stdlib-short-mangling-lookups=0
2540+
swift-stdlib-experimental-hermetic-seal-at-link=1
25422541

25432542
[preset: stdlib_S_standalone_minimal_macho_x86_64,build]
25442543
mixin-preset=

utils/build-script-impl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ KNOWN_SETTINGS=(
203203
sil-verify-all "0" "If enabled, run the SIL verifier after each transform when building Swift files during this build process"
204204
stdlib-deployment-targets "" "space-separated list of targets to configure the Swift standard library to be compiled or cross-compiled for"
205205
swift-objc-interop "" "whether to enable interoperability with Objective-C, default is 1 on Darwin platforms, 0 otherwise"
206+
swift-enable-dispatch "1" "whether to enable use of libdispatch"
207+
swift-implicit-concurrency-import "1" "whether to implicitly import the Swift concurrency module"
206208
swift-enable-compatibility-overrides "1" "whether to support back-deploying compatibility fixes for newer apps running on older runtimes"
207209
swift-enable-reflection "1" "whether to support reflection and mirrors"
208210
swift-stdlib-has-dladdr "1" "whether to build stdlib assuming the runtime environment provides dladdr API"
@@ -217,6 +219,10 @@ KNOWN_SETTINGS=(
217219
swift-stdlib-has-stdin "1" "whether to build stdlib assuming the platform supports stdin and getline API"
218220
swift-stdlib-has-environ "1" "whether to build stdlib assuming the platform supports environment variables"
219221
swift-stdlib-lto "" "enable LLVM LTO on the stdlib, valid values are empty string (no LTO), 'full' and 'thin'"
222+
swift-stdlib-enable-prespecialization "" "whether stdlib should be built with generic metadata prespecialization enabled, defaults to true on Darwin and Linux, false otherwise"
223+
swift-stdlib-passthrough-metadata-allocator "0" "whether stdlib should be built without a custom implementation of MetadataAllocator, relying on malloc+free instead"
224+
swift-stdlib-short-mangling-lookups "1" "whether to build stdlib with fast-path context descriptor lookups based on well-known short manglings"
225+
swift-stdlib-experimental-hermetic-seal-at-link "0" "whether stdlib should be built with -experimental-hermetic-seal-at-link"
220226
swift-disable-dead-stripping "0" "turns off Darwin-specific dead stripping for Swift host tools"
221227
common-swift-flags "" "Flags used for Swift targets other than the stdlib, like the corelibs"
222228

@@ -1989,6 +1995,8 @@ for host in "${ALL_HOSTS[@]}"; do
19891995
-DSWIFT_ANALYZE_CODE_COVERAGE:STRING=$(toupper "${SWIFT_ANALYZE_CODE_COVERAGE}")
19901996
-DSWIFT_STDLIB_BUILD_TYPE:STRING="${SWIFT_STDLIB_BUILD_TYPE}"
19911997
-DSWIFT_STDLIB_ASSERTIONS:BOOL=$(true_false "${SWIFT_STDLIB_ENABLE_ASSERTIONS}")
1998+
-DSWIFT_ENABLE_DISPATCH:BOOL=$(true_false "${SWIFT_ENABLE_DISPATCH}")
1999+
-DSWIFT_IMPLICIT_CONCURRENCY_IMPORT:BOOL=$(true_false "${SWIFT_IMPLICIT_CONCURRENCY_IMPORT}")
19922000
-DSWIFT_ENABLE_COMPATIBILITY_OVERRIDES:BOOL=$(true_false "${SWIFT_ENABLE_COMPATIBILITY_OVERRIDES}")
19932001
-DSWIFT_STDLIB_SINGLE_THREADED_RUNTIME:BOOL=$(true_false "${SWIFT_STDLIB_SINGLE_THREADED_RUNTIME}")
19942002
-DSWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS:BOOL=$(true_false "${SWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS}")
@@ -2000,6 +2008,9 @@ for host in "${ALL_HOSTS[@]}"; do
20002008
-DSWIFT_STDLIB_HAS_STDIN:BOOL=$(true_false "${SWIFT_STDLIB_HAS_STDIN}")
20012009
-DSWIFT_STDLIB_HAS_ENVIRON:BOOL=$(true_false "${SWIFT_STDLIB_HAS_ENVIRON}")
20022010
-DSWIFT_STDLIB_ENABLE_LTO:STRING="${SWIFT_STDLIB_LTO}"
2011+
-DSWIFT_STDLIB_PASSTHROUGH_METADATA_ALLOCATOR:BOOL=$(true_false "${SWIFT_STDLIB_PASSTHROUGH_METADATA_ALLOCATOR}")
2012+
-DSWIFT_STDLIB_SHORT_MANGLING_LOOKUPS:BOOL=$(true_false "${SWIFT_STDLIB_SHORT_MANGLING_LOOKUPS}")
2013+
-DSWIFT_STDLIB_EXPERIMENTAL_HERMETIC_SEAL_AT_LINK:BOOL=$(true_false "${SWIFT_STDLIB_EXPERIMENTAL_HERMETIC_SEAL_AT_LINK}")
20032014
-DSWIFT_NATIVE_LLVM_TOOLS_PATH:STRING="${native_llvm_tools_path}"
20042015
-DSWIFT_NATIVE_CLANG_TOOLS_PATH:STRING="${native_clang_tools_path}"
20052016
-DSWIFT_NATIVE_SWIFT_TOOLS_PATH:STRING="${native_swift_tools_path}"
@@ -2113,6 +2124,13 @@ for host in "${ALL_HOSTS[@]}"; do
21132124
)
21142125
fi
21152126

2127+
if [[ "${SWIFT_STDLIB_ENABLE_PRESPECIALIZATION}" ]] ; then
2128+
cmake_options=(
2129+
"${cmake_options[@]}"
2130+
-DSWIFT_STDLIB_ENABLE_PRESPECIALIZATION:BOOL=$(true_false "${SWIFT_STDLIB_ENABLE_PRESPECIALIZATION}")
2131+
)
2132+
fi
2133+
21162134
if [[ "${SWIFT_STDLIB_SUPPORTS_BACKTRACE_REPORTING}" ]] ; then
21172135
cmake_options=(
21182136
"${cmake_options[@]}"

0 commit comments

Comments
 (0)