mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
We add a new flag to disable the implicit import of `_StringProcessing`, similar to `-disable-implicit-concurrency-module-import`. We need this to build `_RegexParser` when `-enable-experimental-string-processing` is enabled by default, because `_StringProcessing` currently imports `_RegexParser` publicly (non-implementation-only).
51 lines
1.3 KiB
Swift
51 lines
1.3 KiB
Swift
// swift-tools-version:5.3
|
|
|
|
import PackageDescription
|
|
|
|
let package = Package(
|
|
name: "SwiftCompilerSources",
|
|
platforms: [
|
|
.macOS("10.9"),
|
|
],
|
|
products: [
|
|
.library(
|
|
name: "Swift",
|
|
type: .static,
|
|
targets: ["SIL", "Optimizer", "_RegexParser"]),
|
|
],
|
|
dependencies: [
|
|
],
|
|
// Note that all modules must be added to LIBSWIFT_MODULES in the top-level
|
|
// CMakeLists.txt file to get debugging working.
|
|
targets: [
|
|
.target(
|
|
name: "SIL",
|
|
dependencies: [],
|
|
swiftSettings: [SwiftSetting.unsafeFlags([
|
|
"-I", "../include/swift",
|
|
"-cross-module-optimization"
|
|
])]),
|
|
.target(
|
|
name: "_RegexParser",
|
|
dependencies: [],
|
|
swiftSettings: [
|
|
.unsafeFlags([
|
|
"-I", "../include/swift",
|
|
"-cross-module-optimization",
|
|
]),
|
|
// Workaround until `_RegexParser` is imported as implementation-only
|
|
// by `_StringProcessing`.
|
|
.unsafeFlags([
|
|
"-Xfrontend",
|
|
"-disable-implicit-string-processing-module-import"
|
|
])]),
|
|
.target(
|
|
name: "Optimizer",
|
|
dependencies: ["SIL", "_RegexParser"],
|
|
swiftSettings: [SwiftSetting.unsafeFlags([
|
|
"-I", "../include/swift",
|
|
"-cross-module-optimization"
|
|
])]),
|
|
]
|
|
)
|