From 54e71d086aca472d6d664bd4da9c6d450225314b Mon Sep 17 00:00:00 2001 From: Kavon Farvardin Date: Thu, 20 Nov 2025 14:27:48 -0800 Subject: [PATCH] OpaqueValues: provide stdlib build option Should allow testing with preset: ``` extra-cmake-options=-DSWIFT_STDLIB_EXTRA_SWIFT_COMPILE_FLAGS=TRUE ``` --- CMakeLists.txt | 4 ++++ stdlib/cmake/modules/SwiftSource.cmake | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ab3db04ebca58..226a44c938768 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -776,6 +776,10 @@ option(SWIFT_STDLIB_ENABLE_STRICT_CONCURRENCY_COMPLETE "Build the stdlib with -strict-concurrency=complete" FALSE) +option(SWIFT_STDLIB_ENABLE_SIL_OPAQUE_VALUES + "Build the stdlib with -enable-sil-opaque-values" + FALSE) + option(SWIFT_ENABLE_SYNCHRONIZATION "Enable build of the Swift Synchronization module" FALSE) diff --git a/stdlib/cmake/modules/SwiftSource.cmake b/stdlib/cmake/modules/SwiftSource.cmake index 98ead31c28e32..325f78475882d 100644 --- a/stdlib/cmake/modules/SwiftSource.cmake +++ b/stdlib/cmake/modules/SwiftSource.cmake @@ -647,6 +647,10 @@ function(_compile_swift_files list(APPEND swift_flags "-strict-concurrency=complete") endif() + if (SWIFT_STDLIB_ENABLE_SIL_OPAQUE_VALUES) + list(APPEND swift_flags "-Xfrontend" "-enable-sil-opaque-values") + endif() + if (SWIFT_STDLIB_USE_RELATIVE_PROTOCOL_WITNESS_TABLES) list(APPEND swift_flags "-Xfrontend" "-enable-relative-protocol-witness-tables") list(APPEND swift_flags "-Xfrontend" "-swift-async-frame-pointer=never")