Skip to content

Commit d42c806

Browse files
committed
Add an option to build the runtime with copy-on-write existentials
1 parent 80732ea commit d42c806

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,10 @@ option(SWIFT_STDLIB_ENABLE_RESILIENCE
270270
"Build the standard libraries and overlays with resilience enabled; see docs/LibraryEvolution.rst"
271271
FALSE)
272272

273+
option(SWIFT_RUNTIME_ENABLE_COW_EXISTENTIALS
274+
"Build the runtime with a copy-on-write implementation for opaque existentials"
275+
FALSE)
276+
273277
option(SWIFT_STDLIB_USE_NONATOMIC_RC
274278
"Build the standard libraries and overlays with nonatomic reference count operations enabled"
275279
FALSE)

cmake/modules/SwiftSource.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ function(_compile_swift_files
243243
list(APPEND swift_flags "-Xfrontend" "-assume-single-threaded")
244244
endif()
245245

246+
if(SWIFT_RUNTIME_ENABLE_COW_EXISTENTIALS)
247+
list(APPEND swift_flags "-Xfrontend" "-enable-cow-existentials")
248+
endif()
249+
246250
if(SWIFT_STDLIB_ENABLE_SIL_OWNERSHIP AND SWIFTFILE_IS_STDLIB)
247251
list(APPEND swift_flags "-Xfrontend" "-enable-sil-ownership")
248252
endif()

0 commit comments

Comments
 (0)