|
3 | 3 | import PackageDescription
|
4 | 4 | import Foundation
|
5 | 5 |
|
6 |
| -var swiftSyntaxUnsafeSwiftFlags: [String] = [] |
7 |
| - |
8 | 6 | /// If we are in a controlled CI environment, we can use internal compiler flags
|
9 | 7 | /// to speed up the build or improve it.
|
| 8 | +let swiftSyntaxSwiftSettings: [SwiftSetting] |
10 | 9 | if ProcessInfo.processInfo.environment["SWIFT_BUILD_SCRIPT_ENVIRONMENT"] != nil {
|
11 | 10 | let groupFile = URL(fileURLWithPath: #file)
|
12 | 11 | .deletingLastPathComponent()
|
13 | 12 | .appendingPathComponent("utils")
|
14 | 13 | .appendingPathComponent("group.json")
|
15 |
| - |
16 |
| - swiftSyntaxUnsafeSwiftFlags += ["-Xfrontend", "-group-info-path", |
17 |
| - "-Xfrontend", groupFile.path] |
18 |
| - // Enforcing exclusivity increases compile time of release builds by 2 minutes. |
19 |
| - // Disable it when we're in a controlled CI environment. |
20 |
| - swiftSyntaxUnsafeSwiftFlags += ["-enforce-exclusivity=unchecked"] |
| 14 | + swiftSyntaxSwiftSettings = [.unsafeFlags([ |
| 15 | + "-Xfrontend", "-group-info-path", |
| 16 | + "-Xfrontend", groupFile.path, |
| 17 | + // Enforcing exclusivity increases compile time of release builds by 2 minutes. |
| 18 | + // Disable it when we're in a controlled CI environment. |
| 19 | + "-enforce-exclusivity=unchecked", |
| 20 | + ])] |
| 21 | +} else { |
| 22 | + swiftSyntaxSwiftSettings = [] |
21 | 23 | }
|
22 | 24 |
|
23 | 25 | let package = Package(
|
@@ -54,7 +56,7 @@ let package = Package(
|
54 | 56 | "SyntaxNodes.swift.gyb.template",
|
55 | 57 | "SyntaxKind.swift.gyb",
|
56 | 58 | ],
|
57 |
| - swiftSettings: [.unsafeFlags(swiftSyntaxUnsafeSwiftFlags)] |
| 59 | + swiftSettings: swiftSyntaxSwiftSettings |
58 | 60 | ),
|
59 | 61 | .target(
|
60 | 62 | name: "SwiftSyntaxBuilder",
|
|
0 commit comments