mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user