Skip to content

Commit 26bfe10

Browse files
committed
[SwiftCompilerSources] NFC: Allow building Package.swift
Tweak the compiler flags such that it can be built from within Xcode. This is only useful when editing, but I find it very handy.
1 parent 22592d2 commit 26bfe10

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

SwiftCompilerSources/Package.swift

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14+
// To successfully build, you'll need to create a couple of symlinks to an
15+
// existing Ninja build:
16+
//
17+
// ln -s <project-root>/build/<Ninja-Build>/llvm-<os+arch> <project-root>/build/Default/llvm
18+
// ln -s <project-root>/build/<Ninja-Build>/swift-<os+arch> <project-root>/build/Default/swift
19+
//
20+
// where <project-root> is the parent directory of the swift repository.
21+
//
22+
// FIXME: We may want to consider generating Package.swift as a part of the
23+
// build.
24+
1425
import PackageDescription
1526

1627
private extension Target {
@@ -30,9 +41,14 @@ private extension Target {
3041
.interoperabilityMode(.Cxx),
3142
.unsafeFlags([
3243
"-static",
44+
"-Xcc", "-DCOMPILED_WITH_SWIFT", "-Xcc", "-DPURE_BRIDGING_MODE",
45+
"-Xcc", "-UIBOutlet", "-Xcc", "-UIBAction", "-Xcc", "-UIBInspectable",
3346
"-Xcc", "-I../include",
3447
"-Xcc", "-I../../llvm-project/llvm/include",
3548
"-Xcc", "-I../../llvm-project/clang/include",
49+
"-Xcc", "-I../../build/Default/swift/include",
50+
"-Xcc", "-I../../build/Default/llvm/include",
51+
"-Xcc", "-I../../build/Default/llvm/tools/clang/include",
3652
"-cross-module-optimization",
3753
]),
3854
] + swiftSettings)
@@ -42,7 +58,7 @@ private extension Target {
4258
let package = Package(
4359
name: "SwiftCompilerSources",
4460
platforms: [
45-
.macOS("10.9"),
61+
.macOS(.v13),
4662
],
4763
products: [
4864
.library(

0 commit comments

Comments
 (0)