Skip to content

Commit 8983930

Browse files
authored
Update CMake settings to match recent package changes (#497)
A few fixes to the CMake and package build settings: - Enable Swift 6 language mode, to match the package which now uses this language mode due to the change which bumped `swift-tools-version` to 6.0. - Add SourceLocation macro-related source files, which were missing. - Add fake `visionOS 99.0` OS version to our `_distantFuture` availability definition. - Clean up experimental/upcoming features which are no longer needed. ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [x] If public symbols are renamed or modified, DocC references should be updated.
1 parent bfd57a6 commit 8983930

File tree

6 files changed

+4
-4
lines changed

6 files changed

+4
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
2525

2626
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDLL)
2727
set(CMAKE_CXX_STANDARD 20)
28+
set(CMAKE_Swift_LANGUAGE_VERSION 6)
2829
set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift)
2930

3031
add_subdirectory(Sources)

Package.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ extension Array where Element == PackageDescription.SwiftSetting {
119119
static var packageSettings: Self {
120120
availabilityMacroSettings + [
121121
.unsafeFlags(["-require-explicit-sendable"]),
122-
.enableExperimentalFeature("StrictConcurrency"),
123122
.enableUpcomingFeature("ExistentialAny"),
124123

125124
.enableExperimentalFeature("AccessLevelOnImport"),

Sources/Testing/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ add_library(Testing
5555
SourceAttribution/Expression+Macro.swift
5656
SourceAttribution/SourceContext.swift
5757
SourceAttribution/SourceLocation.swift
58+
SourceAttribution/SourceLocation+Macro.swift
5859
Support/Additions/ArrayAdditions.swift
5960
Support/Additions/CollectionDifferenceAdditions.swift
6061
Support/Additions/CommandLineAdditions.swift

Sources/TestingMacros/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ include(AvailabilityDefinitions)
3737
include(CompilerSettings)
3838
add_executable(TestingMacros
3939
ConditionMacro.swift
40+
SourceLocationMacro.swift
4041
SuiteDeclarationMacro.swift
4142
Support/Additions/DeclGroupSyntaxAdditions.swift
4243
Support/Additions/EditorPlaceholderExprSyntaxAdditions.swift

cmake/modules/shared/AvailabilityDefinitions.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ add_compile_options(
1717
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-experimental-feature -Xfrontend \"AvailabilityMacro=_clockAPI:macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0\">"
1818
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-experimental-feature -Xfrontend \"AvailabilityMacro=_regexAPI:macOS 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0\">"
1919
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-experimental-feature -Xfrontend \"AvailabilityMacro=_swiftVersionAPI:macOS 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0\">"
20-
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-experimental-feature -Xfrontend \"AvailabilityMacro=_distantFuture:macOS 99.0, iOS 99.0, watchOS 99.0, tvOS 99.0\">")
20+
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-experimental-feature -Xfrontend \"AvailabilityMacro=_distantFuture:macOS 99.0, iOS 99.0, watchOS 99.0, tvOS 99.0, visionOS 99.0\">")

cmake/modules/shared/CompilerSettings.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@
1111
add_compile_options(
1212
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -require-explicit-sendable>")
1313
add_compile_options(
14-
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-experimental-feature -Xfrontend StrictConcurrency>"
1514
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-experimental-feature -Xfrontend AccessLevelOnImport>")
1615
add_compile_options(
1716
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-upcoming-feature -Xfrontend ExistentialAny>"
18-
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-upcoming-feature -Xfrontend InferSendableFromCaptures>"
1917
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-upcoming-feature -Xfrontend InternalImportsByDefault>")
2018

2119
# Platform specific defines.

0 commit comments

Comments
 (0)