Skip to content

SwiftCompilerSources: update Package.swift #67810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 10 additions & 16 deletions SwiftCompilerSources/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.4
// swift-tools-version:5.9
//===--- Package.swift.in - SwiftCompiler SwiftPM package -----------------===//
//
// This source file is part of the Swift.org open source project
Expand All @@ -14,20 +14,6 @@
import PackageDescription

private extension Target {
static let defaultSwiftSettings: [SwiftSetting] = [
.unsafeFlags([
"-Xfrontend", "-validate-tbd-against-ir=none",
"-Xfrontend", "-enable-experimental-cxx-interop",
// 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],
Expand All @@ -40,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)
}
}

Expand Down