Skip to content

Commit 5b23b23

Browse files
authored
Merge pull request #69402 from kavon/noncopyable-generics-stdlib
[NoncopyableGenerics] provide stdlib build option
2 parents c40879e + 3da894d commit 5b23b23

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

stdlib/cmake/modules/StdlibOptions.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ option(SWIFT_STDLIB_EXPERIMENTAL_HERMETIC_SEAL_AT_LINK
168168
"Should stdlib be built with -experimental-hermetic-seal-at-link"
169169
FALSE)
170170

171+
option(SWIFT_STDLIB_EXPERIMENTAL_NONCOPYABLE_GENERICS
172+
"Should stdlib be built with -experimental-feature NoncopyableGenerics"
173+
FALSE)
174+
171175
option(SWIFT_STDLIB_PASSTHROUGH_METADATA_ALLOCATOR
172176
"Build stdlib without a custom implementation of MetadataAllocator, relying on malloc+free instead."
173177
FALSE)

stdlib/cmake/modules/SwiftSource.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,10 @@ function(_compile_swift_files
578578
list(APPEND swift_flags "-experimental-hermetic-seal-at-link")
579579
endif()
580580

581+
if(SWIFT_STDLIB_EXPERIMENTAL_NONCOPYABLE_GENERICS)
582+
list(APPEND swift_flags "-enable-experimental-feature" "NoncopyableGenerics")
583+
endif()
584+
581585
if (SWIFT_STDLIB_USE_RELATIVE_PROTOCOL_WITNESS_TABLES)
582586
list(APPEND swift_flags "-Xfrontend" "-enable-relative-protocol-witness-tables")
583587
list(APPEND swift_flags "-Xfrontend" "-swift-async-frame-pointer=never")
@@ -1181,4 +1185,3 @@ function(_compile_swift_files
11811185
LANGUAGE C
11821186
OBJECT_DEPENDS "${source_files}")
11831187
endfunction()
1184-

utils/build-script-impl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ KNOWN_SETTINGS=(
236236
swift-stdlib-short-mangling-lookups "1" "whether to build stdlib with fast-path context descriptor lookups based on well-known short manglings"
237237
swift-stdlib-enable-vector-types "1" "whether to build stdlib with support for SIMD and vector types"
238238
swift-stdlib-experimental-hermetic-seal-at-link "0" "whether stdlib should be built with -experimental-hermetic-seal-at-link"
239+
swift-stdlib-experimental-noncopyable-generics "0" "whether stdlib should be built with -enable-experimental-feature NoncopyableGenerics"
239240
swift-stdlib-disable-instantiation-caches "0" "whether to build stdlib with -disable-preallocated-instantiation-caches"
240241
swift-stdlib-has-type-printing "1" "whether stdlib should support printing user-friendly type name as strings at runtime"
241242
swift-stdlib-trap-function "" "Name of function to call instead of emitting a trap instruction"
@@ -1851,6 +1852,7 @@ for host in "${ALL_HOSTS[@]}"; do
18511852
-DSWIFT_STDLIB_HAS_TYPE_PRINTING:BOOL=$(true_false "${SWIFT_STDLIB_HAS_TYPE_PRINTING}")
18521853
-DSWIFT_STDLIB_TRAP_FUNCTION:STRING="${SWIFT_STDLIB_TRAP_FUNCTION}"
18531854
-DSWIFT_STDLIB_EXPERIMENTAL_HERMETIC_SEAL_AT_LINK:BOOL=$(true_false "${SWIFT_STDLIB_EXPERIMENTAL_HERMETIC_SEAL_AT_LINK}")
1855+
-DSWIFT_STDLIB_EXPERIMENTAL_NONCOPYABLE_GENERICS:BOOL=$(true_false "${SWIFT_STDLIB_EXPERIMENTAL_NONCOPYABLE_GENERICS}")
18541856
-DSWIFT_STDLIB_DISABLE_INSTANTIATION_CACHES:BOOL=$(true_false "${SWIFT_STDLIB_DISABLE_INSTANTIATION_CACHES}")
18551857
-DSWIFT_STDLIB_REFLECTION_METADATA:STRING="${SWIFT_STDLIB_REFLECTION_METADATA}"
18561858
-DSWIFT_NATIVE_LLVM_TOOLS_PATH:STRING="${native_llvm_tools_path}"

0 commit comments

Comments
 (0)