Skip to content

Commit 39941a7

Browse files
authored
Merge pull request #84525 from etcwilde/ewilde/set-language-versions
CMake: Set language version across supplemental libs
2 parents 3f610e9 + a0538ae commit 39941a7

File tree

9 files changed

+10
-18
lines changed

9 files changed

+10
-18
lines changed

Runtimes/Core/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ add_link_options($<$<PLATFORM_ID:Android,Linux>:LINKER:-z,defs>)
181181
add_compile_options(
182182
$<$<COMPILE_LANGUAGE:Swift>:-explicit-module-build>
183183
"$<$<COMPILE_LANGUAGE:Swift>:-nostdlibimport>"
184-
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-swift-version 5>"
185184
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-library-level api>"
186185
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-runtime-compatibility-version none>"
187186
"$<$<COMPILE_LANGUAGE:Swift>:-disable-autolinking-runtime-compatibility-dynamic-replacements>"

Runtimes/Overlay/Cxx/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ target_compile_options(swiftCxx PRIVATE
3131
# This module should not pull in the C++ standard library, so we disable it
3232
# explicitly. For functionality that depends on the C++ stdlib, use C++
3333
# stdlib overlay (`swiftstd` module).
34-
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-swift-version 5>"
3534
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xcc -nostdinc++>"
3635
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature AllowUnsafeAttribute>"
3736
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature BuiltinModule>"

Runtimes/Supplemental/Differentiation/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ add_compile_options(
6666
$<$<COMPILE_LANGUAGE:Swift>:-explicit-module-build>
6767
$<$<COMPILE_LANGUAGE:Swift>:-nostdlibimport>
6868
$<$<COMPILE_LANGUAGE:Swift>:-parse-stdlib>
69-
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-swift-version 5>"
7069
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-library-level api>"
7170
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature NoncopyableGenerics2>"
7271
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature SuppressedAssociatedTypes>"

Runtimes/Supplemental/Distributed/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ list(APPEND CMAKE_MODULE_PATH
1313
"${CMAKE_SOURCE_DIR}/../cmake/modules"
1414
"${CMAKE_SOURCE_DIR}/../../cmake/modules")
1515

16+
include(LanguageVersions)
1617
include(SwiftProjectVersion)
1718
project(SwiftDistributed
1819
LANGUAGES C CXX Swift
@@ -22,17 +23,10 @@ if(NOT PROJECT_IS_TOP_LEVEL)
2223
message(SEND_ERROR "Swift Distributed must build as a standalone project")
2324
endif()
2425

25-
set(CMAKE_Swift_LANGUAGE_VERSION 5)
26-
2726
set(CMAKE_POSITION_INDEPENDENT_CODE YES)
2827

2928
set(CMAKE_C_VISIBILITY_PRESET "hidden")
30-
31-
set(CMAKE_CXX_EXTENSIONS NO)
32-
set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to conform to")
33-
set(CMAKE_CXX_STANDARD_REQUIRED YES)
3429
set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
35-
3630
set(CMAKE_VISIBILITY_INLINES_HIDDEN YES)
3731

3832
set(${PROJECT_NAME}_SWIFTC_SOURCE_DIR
@@ -75,7 +69,6 @@ add_compile_options(
7569
$<$<COMPILE_LANGUAGE:Swift>:-explicit-module-build>
7670
$<$<COMPILE_LANGUAGE:Swift>:-nostdlibimport>
7771
$<$<COMPILE_LANGUAGE:Swift>:-strict-memory-safety>
78-
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-swift-version 5>"
7972
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature NoncopyableGenerics2>"
8073
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature SuppressedAssociatedTypes>"
8174
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature SE427NoInferenceOnExtension>"

Runtimes/Supplemental/Observation/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ list(APPEND CMAKE_MODULE_PATH
1313
"${CMAKE_SOURCE_DIR}/../cmake/modules"
1414
"${CMAKE_SOURCE_DIR}/../../cmake/modules")
1515

16+
include(LanguageVersions)
1617
include(SwiftProjectVersion)
1718
project(SwiftObservation
1819
LANGUAGES Swift CXX
@@ -22,9 +23,6 @@ if(NOT PROJECT_IS_TOP_LEVEL)
2223
message(SEND_ERROR "Swift Observation must build as a standalone project")
2324
endif()
2425

25-
set(CMAKE_CXX_STANDARD 17)
26-
set(CMAKE_CXX_STANDARD_REQUIRED YES)
27-
set(CMAKE_CXX_EXTENSIONS NO)
2826
set(CMAKE_POSITION_INDEPENDENT_CODE YES)
2927

3028
set(${PROJECT_NAME}_SWIFTC_SOURCE_DIR
@@ -66,7 +64,6 @@ option(${PROJECT_NAME}_ENABLE_PRESPECIALIZATION "Enable generic metadata prespec
6664
add_compile_options(
6765
$<$<COMPILE_LANGUAGE:Swift>:-explicit-module-build>
6866
$<$<COMPILE_LANGUAGE:Swift>:-nostdlibimport>
69-
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-swift-version 5>"
7067
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -enforce-exclusivity=unchecked>"
7168
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -target-min-inlining-version -Xfrontend min>"
7269
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-implicit-string-processing-module-import>"

Runtimes/Supplemental/StringProcessing/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ list(APPEND CMAKE_MODULE_PATH
1414
"${CMAKE_SOURCE_DIR}/../cmake/modules"
1515
"${CMAKE_SOURCE_DIR}/../../cmake/modules")
1616

17+
include(LanguageVersions)
1718
include(SwiftProjectVersion)
1819
project(SwiftStringProcessing
1920
LANGUAGES Swift C
@@ -52,7 +53,6 @@ option(${PROJECT_NAME}_ENABLE_PRESPECIALIZATION "Enable generic metadata prespec
5253
add_compile_options(
5354
$<$<COMPILE_LANGUAGE:Swift>:-explicit-module-build>
5455
$<$<COMPILE_LANGUAGE:Swift>:-nostdlibimport>
55-
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-swift-version 5>"
5656
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-implicit-concurrency-module-import>"
5757
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-implicit-string-processing-module-import>"
5858
"$<$<COMPILE_LANGUAGE:Swift>:-warn-implicit-overrides>"

Runtimes/Supplemental/Synchronization/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ list(APPEND CMAKE_MODULE_PATH
1313
"${CMAKE_SOURCE_DIR}/../cmake/modules"
1414
"${CMAKE_SOURCE_DIR}/../../cmake/modules")
1515

16+
include(LanguageVersions)
1617
include(SwiftProjectVersion)
1718
project(SwiftSynchronization
1819
LANGUAGES Swift
@@ -71,7 +72,6 @@ add_compile_options(
7172
$<$<COMPILE_LANGUAGE:Swift>:-nostdlibimport>
7273
$<$<COMPILE_LANGUAGE:Swift>:-enable-builtin-module>
7374
$<$<COMPILE_LANGUAGE:Swift>:-strict-memory-safety>
74-
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-swift-version 5>"
7575
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature NoncopyableGenerics2>"
7676
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature SuppressedAssociatedTypes>"
7777
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature SE427NoInferenceOnExtension>"

Runtimes/Supplemental/Volatile/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ list(APPEND CMAKE_MODULE_PATH
1313
"${CMAKE_SOURCE_DIR}/../cmake/modules"
1414
"${CMAKE_SOURCE_DIR}/../../cmake/modules")
1515

16+
include(LanguageVersions)
1617
include(SwiftProjectVersion)
1718
project(SwiftVolatile
1819
LANGUAGES Swift
@@ -66,7 +67,6 @@ add_compile_options(
6667
$<$<COMPILE_LANGUAGE:Swift>:-explicit-module-build>
6768
$<$<COMPILE_LANGUAGE:Swift>:-nostdlibimport>
6869
$<$<COMPILE_LANGUAGE:Swift>:-strict-memory-safety>
69-
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-swift-version 5>"
7070
"$<$<AND:$<BOOL:${${PROJECT_NAME}_ENABLE_LIBRARY_EVOLUTION}>,$<COMPILE_LANGUAGE:Swift>>:-enable-library-evolution>"
7171
"$<$<AND:$<BOOL:${${PROJECT_NAME}_ENABLE_PRESPECIALIZATION}>,$<COMPILE_LANGUAGE:Swift>>:SHELL:-Xfrontend -prespecialize-generic-metadata>")
7272

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
set(CMAKE_Swift_LANGUAGE_VERSION 5)
2+
3+
set(CMAKE_CXX_STANDARD 17)
4+
set(CMAKE_CXX_STANDARD_REQUIRED YES)
5+
set(CMAKE_CXX_EXTENSIONS NO)

0 commit comments

Comments
 (0)