mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[docs] GettingStarted: Restructure "The actual build" section
This commit is contained in:
@@ -253,42 +253,31 @@ Phew, that's a lot to digest! Now let's proceed to the actual build itself!
|
|||||||
|
|
||||||
### The actual build
|
### The actual build
|
||||||
|
|
||||||
1. Build the toolchain with optimizations, debuginfo, and assertions, using
|
Build the toolchain with optimizations, debuginfo, and assertions, using Ninja:
|
||||||
Ninja.
|
|
||||||
- macOS:
|
|
||||||
```sh
|
|
||||||
utils/build-script --skip-build-benchmarks \
|
|
||||||
--skip-ios --skip-watchos --skip-tvos --swift-darwin-supported-archs "$(uname -m)" \
|
|
||||||
--sccache --release-debuginfo --swift-disable-dead-stripping \
|
|
||||||
--bootstrapping=hosttools
|
|
||||||
```
|
|
||||||
- Linux:
|
|
||||||
```sh
|
|
||||||
utils/build-script --release-debuginfo
|
|
||||||
```
|
|
||||||
If you installed and want to use Sccache, include the `--sccache` option in
|
|
||||||
the invocation as well.
|
|
||||||
<!-- FIXME: Without this "hard" line break, the note doesn’t get properly spaced from the bullet -->
|
|
||||||
<br />
|
|
||||||
|
|
||||||
> **Note**
|
- macOS:
|
||||||
> If you are planning to work on the compiler on macOS, but not the parts that are
|
```sh
|
||||||
> written in Swift, pass `--bootstrapping=hosttools` to speed up local
|
utils/build-script --skip-build-benchmarks \
|
||||||
> development.
|
--skip-ios --skip-watchos --skip-tvos --swift-darwin-supported-archs "$(uname -m)" \
|
||||||
|
--sccache --release-debuginfo --swift-disable-dead-stripping \
|
||||||
|
--bootstrapping=hosttools
|
||||||
|
```
|
||||||
|
- Linux:
|
||||||
|
```sh
|
||||||
|
utils/build-script --release-debuginfo
|
||||||
|
```
|
||||||
|
- If you want to additionally build the Swift core libraries, i.e.,
|
||||||
|
swift-corelibs-libdispatch, swift-corelibs-foundation, and
|
||||||
|
swift-corelibs-xctest, add `--xctest` to the invocation.
|
||||||
|
|
||||||
This will create a directory `swift-project/build/Ninja-RelWithDebInfoAssert`
|
- If you installed and want to use Sccache, add `--sccache` to the invocation.
|
||||||
containing the Swift compiler and standard library and clang/LLVM build artifacts.
|
- If you want to use a debugger such as LLDB on compiler sources, add
|
||||||
If the build fails, see [Troubleshooting build issues](#troubleshooting-build-issues).
|
`--debug-swift` to the invocation: a fruitful debugging experience warrants
|
||||||
|
non-optimized code besides debug information.
|
||||||
|
|
||||||
> **Note**
|
This will create a directory `swift-project/build/Ninja-RelWithDebInfoAssert`
|
||||||
> `--release-debuginfo` means that although debug information will be produced, all targets will
|
containing the Swift compiler and standard library and clang/LLVM build artifacts.
|
||||||
> be compiled in release mode, meaning optimized code, which can affect your debugging experience.
|
If the build fails, see [Troubleshooting build issues](#troubleshooting-build-issues).
|
||||||
> Consider [`--debug-swift` to build a debug variant of the compiler](#debugging-issues) and have
|
|
||||||
> the swift targets (including `swift-frontend`) built in debug mode.
|
|
||||||
|
|
||||||
On Linux, if you would like to additionally build the Swift corelibs,
|
|
||||||
ie swift-corelibs-libdispatch, swift-corelibs-foundation, and swift-corelibs-xctest,
|
|
||||||
add the `--xctest` flag to `build-script`.
|
|
||||||
|
|
||||||
In the following sections, for simplicity, we will assume that you are using a
|
In the following sections, for simplicity, we will assume that you are using a
|
||||||
`Ninja-RelWithDebInfoAssert` build on macOS, unless explicitly mentioned otherwise.
|
`Ninja-RelWithDebInfoAssert` build on macOS, unless explicitly mentioned otherwise.
|
||||||
|
|||||||
Reference in New Issue
Block a user