Skip to content

Commit f2995a3

Browse files
committed
Optionally build the compiler and _Concurrency library for back deployment.
When enabling the build of the back-deployable concurrency library via the build-script option `--back-deploy-concurrency`, also build the compiler and (main) concurrency library to support older deployment targets. Building the compiler for older deployment targets is effectively the same as implicitly passing `-Xfrontend -enable-experimental-back-deploy-concurrency`. That option should probably go away. Building the primary _Concurrency library for back-deployment means setting the "SwiftStdlib 5.5" availability back to the earlier deployment targets. This should have no effect on how the _Concurrency library binary is built, but it does ensure that the right availability annotations are in the _Concurrency module.
1 parent 3f749dc commit f2995a3

File tree

5 files changed

+9
-3
lines changed

5 files changed

+9
-3
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ namespace swift {
302302
bool EnableExperimentalConcurrency = false;
303303

304304
/// Enable experimental back-deployment of the concurrency model.
305-
bool EnableExperimentalBackDeployConcurrency = false;
305+
bool EnableExperimentalBackDeployConcurrency =
306+
SWIFT_ALLOW_BACK_DEPLOY_CONCURRENCY;
306307

307308
/// Enable experimental support for named opaque result types, e.g.
308309
/// `func f() -> <T> T`.

include/swift/Config.h.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@
1414

1515
#cmakedefine01 SWIFT_ENABLE_GLOBAL_ISEL_ARM64
1616

17+
#cmakedefine01 SWIFT_ALLOW_BACK_DEPLOY_CONCURRENCY
18+
1719
#endif // SWIFT_CONFIG_H

stdlib/public/BackDeployConcurrency/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,5 @@ add_compile_definitions(SWIFT_CONCURRENCY_BACK_DEPLOYMENT)
4141
set(swift_concurrency_swift_flags -Xfrontend -enable-experimental-back-deploy-concurrency)
4242
set(swift_concurrency_install_component back-deployment)
4343
set(swift_concurrency_options BACK_DEPLOYMENT_LIBRARY 5.5)
44-
set(swift_concurrency_availability "macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0")
4544

4645
add_subdirectory(../Concurrency stdlib/public/BackDeployConcurrency)

stdlib/public/Concurrency/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
set(LLVM_OPTIONAL_SOURCES
1414
${swift_concurrency_objc_sources})
1515

16-
if(NOT swift_concurrency_availability)
16+
if (SWIFT_ALLOW_BACK_DEPLOY_CONCURRENCY OR BUILD_SWIFT_CONCURRENCY_BACK_DEPLOYMENT_LIBRARIES)
17+
set(swift_concurrency_availability "macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0")
18+
else()
1719
set(swift_concurrency_availability "macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0")
1820
endif()
1921

utils/swift_build_support/swift_build_support/build_script_invocation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ def convert_to_impl_arguments(self):
233233

234234
if args.swift_disable_dead_stripping:
235235
args.extra_cmake_options.append('-DSWIFT_DISABLE_DEAD_STRIPPING:BOOL=TRUE')
236+
if args.build_backdeployconcurrency:
237+
args.extra_cmake_options.append('-DSWIFT_ALLOW_BACK_DEPLOY_CONCURRENCY:BOOL=TRUE')
236238

237239
# Then add subproject install flags that either skip building them /or/
238240
# if we are going to build them and install_all is set, we also install

0 commit comments

Comments
 (0)