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.
This commit is contained in:
Saleem Abdulrasool
2023-08-09 08:07:33 -07:00
parent 425dd58661
commit d1714631ce

View File

@@ -14,19 +14,6 @@
import PackageDescription
private extension Target {
static let defaultSwiftSettings: [SwiftSetting] = [
.interoperabilityMode(.Cxx),
.unsafeFlags([
// Bridging modules and headers
"-Xcc", "-I", "-Xcc", "../include",
// LLVM modules and headers
"-Xcc", "-I", "-Xcc", "../../llvm-project/llvm/include",
// Clang modules and headers
"-Xcc", "-I", "-Xcc", "../../llvm-project/clang/include",
"-cross-module-optimization"
]),
]
static func compilerModuleTarget(
name: String,
dependencies: [Dependency],
@@ -39,7 +26,15 @@ private extension Target {
path: path ?? "Sources/\(name)",
exclude: ["CMakeLists.txt"],
sources: sources,
swiftSettings: defaultSwiftSettings + swiftSettings)
cxxSettings: [
.headerSearchPath("../include"),
.headerSearchPath("../../llvm-project/llvm/include"),
.headerSearchPath("../../llvm-project/clang/include"),
],
swiftSettings: [
.interoperabilityMode(.Cxx),
.unsafeFlags(["-cross-module-optimization"]),
] + swiftSettings)
}
}