diff --git a/Runtimes/Core/CMakeLists.txt b/Runtimes/Core/CMakeLists.txt index ff1b35cd93e82..c255750512c31 100644 --- a/Runtimes/Core/CMakeLists.txt +++ b/Runtimes/Core/CMakeLists.txt @@ -181,7 +181,6 @@ add_link_options($<$:LINKER:-z,defs>) add_compile_options( $<$:-explicit-module-build> "$<$:-nostdlibimport>" - "$<$:SHELL:-swift-version 5>" "$<$:SHELL:-library-level api>" "$<$:SHELL:-runtime-compatibility-version none>" "$<$:-disable-autolinking-runtime-compatibility-dynamic-replacements>" diff --git a/Runtimes/Overlay/Cxx/CMakeLists.txt b/Runtimes/Overlay/Cxx/CMakeLists.txt index f6317d066fdc1..5f43f25409f7c 100644 --- a/Runtimes/Overlay/Cxx/CMakeLists.txt +++ b/Runtimes/Overlay/Cxx/CMakeLists.txt @@ -31,7 +31,6 @@ target_compile_options(swiftCxx PRIVATE # This module should not pull in the C++ standard library, so we disable it # explicitly. For functionality that depends on the C++ stdlib, use C++ # stdlib overlay (`swiftstd` module). - "$<$:SHELL:-swift-version 5>" "$<$:SHELL:-Xcc -nostdinc++>" "$<$:SHELL:-enable-experimental-feature AllowUnsafeAttribute>" "$<$:SHELL:-enable-experimental-feature BuiltinModule>" diff --git a/Runtimes/Supplemental/Differentiation/CMakeLists.txt b/Runtimes/Supplemental/Differentiation/CMakeLists.txt index a7491307fc652..20cc38a989fbd 100644 --- a/Runtimes/Supplemental/Differentiation/CMakeLists.txt +++ b/Runtimes/Supplemental/Differentiation/CMakeLists.txt @@ -66,7 +66,6 @@ add_compile_options( $<$:-explicit-module-build> $<$:-nostdlibimport> $<$:-parse-stdlib> - "$<$:SHELL:-swift-version 5>" "$<$:SHELL:-library-level api>" "$<$:SHELL:-enable-experimental-feature NoncopyableGenerics2>" "$<$:SHELL:-enable-experimental-feature SuppressedAssociatedTypes>" diff --git a/Runtimes/Supplemental/Distributed/CMakeLists.txt b/Runtimes/Supplemental/Distributed/CMakeLists.txt index 6bea6fa1cc292..140236c76d8ec 100644 --- a/Runtimes/Supplemental/Distributed/CMakeLists.txt +++ b/Runtimes/Supplemental/Distributed/CMakeLists.txt @@ -13,6 +13,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake/modules" "${CMAKE_SOURCE_DIR}/../../cmake/modules") +include(LanguageVersions) include(SwiftProjectVersion) project(SwiftDistributed LANGUAGES C CXX Swift @@ -22,17 +23,10 @@ if(NOT PROJECT_IS_TOP_LEVEL) message(SEND_ERROR "Swift Distributed must build as a standalone project") endif() -set(CMAKE_Swift_LANGUAGE_VERSION 5) - set(CMAKE_POSITION_INDEPENDENT_CODE YES) set(CMAKE_C_VISIBILITY_PRESET "hidden") - -set(CMAKE_CXX_EXTENSIONS NO) -set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to conform to") -set(CMAKE_CXX_STANDARD_REQUIRED YES) set(CMAKE_CXX_VISIBILITY_PRESET "hidden") - set(CMAKE_VISIBILITY_INLINES_HIDDEN YES) set(${PROJECT_NAME}_SWIFTC_SOURCE_DIR @@ -75,7 +69,6 @@ add_compile_options( $<$:-explicit-module-build> $<$:-nostdlibimport> $<$:-strict-memory-safety> - "$<$:SHELL:-swift-version 5>" "$<$:SHELL:-enable-experimental-feature NoncopyableGenerics2>" "$<$:SHELL:-enable-experimental-feature SuppressedAssociatedTypes>" "$<$:SHELL:-enable-experimental-feature SE427NoInferenceOnExtension>" diff --git a/Runtimes/Supplemental/Observation/CMakeLists.txt b/Runtimes/Supplemental/Observation/CMakeLists.txt index 59434af525484..b008a71329a61 100644 --- a/Runtimes/Supplemental/Observation/CMakeLists.txt +++ b/Runtimes/Supplemental/Observation/CMakeLists.txt @@ -13,6 +13,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake/modules" "${CMAKE_SOURCE_DIR}/../../cmake/modules") +include(LanguageVersions) include(SwiftProjectVersion) project(SwiftObservation LANGUAGES Swift CXX @@ -22,9 +23,6 @@ if(NOT PROJECT_IS_TOP_LEVEL) message(SEND_ERROR "Swift Observation must build as a standalone project") endif() -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED YES) -set(CMAKE_CXX_EXTENSIONS NO) set(CMAKE_POSITION_INDEPENDENT_CODE YES) set(${PROJECT_NAME}_SWIFTC_SOURCE_DIR @@ -66,7 +64,6 @@ option(${PROJECT_NAME}_ENABLE_PRESPECIALIZATION "Enable generic metadata prespec add_compile_options( $<$:-explicit-module-build> $<$:-nostdlibimport> - "$<$:SHELL:-swift-version 5>" "$<$:SHELL:-Xfrontend -enforce-exclusivity=unchecked>" "$<$:SHELL:-Xfrontend -target-min-inlining-version -Xfrontend min>" "$<$:SHELL:-Xfrontend -disable-implicit-string-processing-module-import>" diff --git a/Runtimes/Supplemental/StringProcessing/CMakeLists.txt b/Runtimes/Supplemental/StringProcessing/CMakeLists.txt index 756f170dc0127..c12ccddba7d0c 100644 --- a/Runtimes/Supplemental/StringProcessing/CMakeLists.txt +++ b/Runtimes/Supplemental/StringProcessing/CMakeLists.txt @@ -14,6 +14,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake/modules" "${CMAKE_SOURCE_DIR}/../../cmake/modules") +include(LanguageVersions) include(SwiftProjectVersion) project(SwiftStringProcessing LANGUAGES Swift C @@ -52,7 +53,6 @@ option(${PROJECT_NAME}_ENABLE_PRESPECIALIZATION "Enable generic metadata prespec add_compile_options( $<$:-explicit-module-build> $<$:-nostdlibimport> - "$<$:SHELL:-swift-version 5>" "$<$:SHELL:-Xfrontend -disable-implicit-concurrency-module-import>" "$<$:SHELL:-Xfrontend -disable-implicit-string-processing-module-import>" "$<$:-warn-implicit-overrides>" diff --git a/Runtimes/Supplemental/Synchronization/CMakeLists.txt b/Runtimes/Supplemental/Synchronization/CMakeLists.txt index 327ab796a1065..7fa91fd9edbf8 100644 --- a/Runtimes/Supplemental/Synchronization/CMakeLists.txt +++ b/Runtimes/Supplemental/Synchronization/CMakeLists.txt @@ -13,6 +13,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake/modules" "${CMAKE_SOURCE_DIR}/../../cmake/modules") +include(LanguageVersions) include(SwiftProjectVersion) project(SwiftSynchronization LANGUAGES Swift @@ -71,7 +72,6 @@ add_compile_options( $<$:-nostdlibimport> $<$:-enable-builtin-module> $<$:-strict-memory-safety> - "$<$:SHELL:-swift-version 5>" "$<$:SHELL:-enable-experimental-feature NoncopyableGenerics2>" "$<$:SHELL:-enable-experimental-feature SuppressedAssociatedTypes>" "$<$:SHELL:-enable-experimental-feature SE427NoInferenceOnExtension>" diff --git a/Runtimes/Supplemental/Volatile/CMakeLists.txt b/Runtimes/Supplemental/Volatile/CMakeLists.txt index 30261e1face46..e11b51d58fb82 100644 --- a/Runtimes/Supplemental/Volatile/CMakeLists.txt +++ b/Runtimes/Supplemental/Volatile/CMakeLists.txt @@ -13,6 +13,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake/modules" "${CMAKE_SOURCE_DIR}/../../cmake/modules") +include(LanguageVersions) include(SwiftProjectVersion) project(SwiftVolatile LANGUAGES Swift @@ -66,7 +67,6 @@ add_compile_options( $<$:-explicit-module-build> $<$:-nostdlibimport> $<$:-strict-memory-safety> - "$<$:SHELL:-swift-version 5>" "$<$,$>:-enable-library-evolution>" "$<$,$>:SHELL:-Xfrontend -prespecialize-generic-metadata>") diff --git a/Runtimes/Supplemental/cmake/modules/LanguageVersions.cmake b/Runtimes/Supplemental/cmake/modules/LanguageVersions.cmake new file mode 100644 index 0000000000000..706661f229ac3 --- /dev/null +++ b/Runtimes/Supplemental/cmake/modules/LanguageVersions.cmake @@ -0,0 +1,5 @@ +set(CMAKE_Swift_LANGUAGE_VERSION 5) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED YES) +set(CMAKE_CXX_EXTENSIONS NO)