Skip to content

Commit 86962b3

Browse files
authored
Merge pull request swiftlang#1289 from nkcsgexi/doc-interface-build
2 parents 6aaa811 + 9fac817 commit 86962b3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,14 @@ The goal of the new Swift driver is to provide a drop-in replacement for the exi
206206
* Integration
207207
* [x] Teach the Swift compiler's [`build-script`](https://github.com/apple/swift/blob/main/utils/build-script) to build `swift-driver`.
208208
* [x] Building on the above, teach the Swift compiler's [`build-toolchain`](https://github.com/apple/swift/blob/main/utils/build-toolchain) to install `swift-driver` as the primary driver so we can test full toolchains with the new driver
209+
210+
### Build all Swift interfaces from an SDK
211+
Based on libSwiftDriver, `swift-build-sdk-interfaces` is a tool to batch build all Swift textual interfaces (`.swiftinterface`) from an SDK into binary modules (`.swiftmodule`). As an example, the following command finds all Swift textual interface from the MacOSX SDK, builds all of them into binary modules, and outputs module-specific error logs into the given directory.
212+
213+
`
214+
$SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk SWIFT_EXEC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc swift-build-sdk-interfaces -o /tmp/outputs -v -log-path /tmp/logs`
215+
216+
* *SDKROOT*: an env var to specify the SDK to work on
217+
* *SWIFT_EXEC*: teach `swift-build-sdk-interfaces` about where to find the Swift compiler to use
218+
* *-O*: the output directory for all binary modules built from textual interfaces
219+
* *-log-path*: where to dump log files when fatal error happens

0 commit comments

Comments
 (0)