Skip to content

Commit d171463

Browse files
committed
SwiftCompilerSources: modernise and inline default flags
Use the `cxxSettings` to pass along header search paths. With those removed, we are simply adding the interoperability mode and unsafe flags, which we can inline. This simplifies the package definition a bit.
1 parent 425dd58 commit d171463

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

SwiftCompilerSources/Package.swift

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,6 @@
1414
import PackageDescription
1515

1616
private extension Target {
17-
static let defaultSwiftSettings: [SwiftSetting] = [
18-
.interoperabilityMode(.Cxx),
19-
.unsafeFlags([
20-
// Bridging modules and headers
21-
"-Xcc", "-I", "-Xcc", "../include",
22-
// LLVM modules and headers
23-
"-Xcc", "-I", "-Xcc", "../../llvm-project/llvm/include",
24-
// Clang modules and headers
25-
"-Xcc", "-I", "-Xcc", "../../llvm-project/clang/include",
26-
"-cross-module-optimization"
27-
]),
28-
]
29-
3017
static func compilerModuleTarget(
3118
name: String,
3219
dependencies: [Dependency],
@@ -39,7 +26,15 @@ private extension Target {
3926
path: path ?? "Sources/\(name)",
4027
exclude: ["CMakeLists.txt"],
4128
sources: sources,
42-
swiftSettings: defaultSwiftSettings + swiftSettings)
29+
cxxSettings: [
30+
.headerSearchPath("../include"),
31+
.headerSearchPath("../../llvm-project/llvm/include"),
32+
.headerSearchPath("../../llvm-project/clang/include"),
33+
],
34+
swiftSettings: [
35+
.interoperabilityMode(.Cxx),
36+
.unsafeFlags(["-cross-module-optimization"]),
37+
] + swiftSettings)
4338
}
4439
}
4540

0 commit comments

Comments
 (0)