Skip to content

Commit a96daff

Browse files
committed
[WindowsBuild] Minor fixes
1 parent 1c95eba commit a96daff

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

docs/WindowsBuild.md

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
Visual Studio 2017 or newer is needed to build Swift on Windows, while VS2019 is recommended and currently used for CI. The free Community edition is sufficient to build Swift, and we're assuming host and target to be both x64.
44

5-
The commands below (with the exception of installing Visual Studio) must be entered in the "**x64 Native** Tools Command Prompt for VS2019" (or VS2017, VS2022 depending on the Visual Studio that you are using) in the Start Menu. This sets environment variables to select the correct target platform.
5+
The commands below (with the exception of installing Visual Studio) must be entered in the **x64 Native Tools Command Prompt for VS2019** (or VS2017, VS2022 depending on the Visual Studio that you are using) in the Start Menu. This sets environment variables to select the correct target platform.
66

7-
> **NOTE:** This guide is intended for toolchain developers who wants to develop or build Swift on their own machine. For building a standard toolchain, please refer to [`build-windows-toolchain.bat`](../utils/build-windows-toolchain.bat).
7+
> **NOTE:** This guide is intended for toolchain developers who wants to develop or build Swift on their own machine. For building and packaging a standard toolchain, please refer to [`build-windows-toolchain.bat`](../utils/build-windows-toolchain.bat).
88
99
## Install dependencies
1010

@@ -24,53 +24,63 @@ vs_community ^
2424
del /q vs_community.exe
2525
```
2626

27+
> **NOTE:** For anyone who wants to use Visual Studio 2022 instead:
28+
> - replace `https://aka.ms/vs/16/release/vs_community.exe` with `https://aka.ms/vs/17/release/vs_community.exe`
29+
> - replace `Component.CPython3.x64` with `Component.CPython39.x64`
30+
2731
If you prefer you can install everything by hand, but make sure to include "Programming Languages|Visual C++" and "Windows and Web Development|Universal Windows App Development|Windows SDK" in your installation. The components listed above are required.
2832

2933
The following [link](https://docs.microsoft.com/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2019) helps in finding the component name given its ID for Visual Studio 2019.
3034

3135
### Python
3236

33-
The command above already installs Python 3. Alternatively, in the Visual Studio installation program, under *Individual Components*, install *Python 3 64 bits (3.9.x)*.
37+
The command above already installs Python 3. Alternatively, in the Visual Studio installation program, under *Individual Components*, install *Python 3 64 bits (3.x.x)*.
3438

3539
If you are building a debug version of Swift, you should also install the Python debug binaries.
3640

3741
1. In the Windows settings, go to *Add and Remove Programs*
38-
2. Select the *Python 3.9.x (64-bit)* entry
42+
2. Select the *Python 3.x.x (64-bit)* entry
3943
3. Click *Modify*, then *Yes*, then *Modify* again and then *Next*
4044
4. Select *Download debug binaries (requires VS 2015 or later)*
4145
5. Click *Install*
4246

4347
## Enable Developer Mode
4448

45-
From the settings application, go to `Update & Security`. In the `For developers` tab, select `Developer Mode` for `Use Developer Features`. This is required to enable the creation of symbolic links.
49+
From the settings application, go to *Update & Security*. In the *For developers* tab, select *Developer Mode* for *Use Developer Features*. This is required to enable the creation of symbolic links.
4650

4751
## Clone the repositories
4852

4953
> **NOTE:** This guide assumes your sources live at the root of `S:`. If your sources live elsewhere, you can create a substitution for this:
50-
> subst S: <path to sources>
54+
>
55+
> subst S: <path to sources>
5156
5257
First, clone `apple/swift` (this repository) with Git:
5358

5459
```cmd
55-
S:
56-
git clone -c core.autocrlf=input -c core.symlinks=true https://github.com/apple/swift
60+
git clone -c core.autocrlf=input -c core.symlinks=true https://github.com/apple/swift S:\swift
5761
```
5862

5963
You'll be able to clone and check out the rest of Swift source repositories with `update-checkout` tool:
6064

6165
```cmd
62-
swift\utils\update-checkout.cmd --clone
66+
S:\swift\utils\update-checkout.cmd --clone
6367
```
6468

6569
## Set up `vcpkg`
6670

67-
The instructions will use `vcpkg` for pulling in external dependencies, including ICU, libcurl, libxml2, SQLite 3 and zlib.
71+
This guide uses `vcpkg` for pulling in external dependencies, including ICU, libcurl, libxml2, SQLite 3 and zlib.
72+
73+
All you have to do is to clone and bootstrap `vcpkg`:
74+
75+
```cmd
76+
git clone https://github.com/microsoft/vcpkg S:\vcpkg
77+
S:\vcpkg\bootstrap-vcpkg.bat
78+
```
6879

69-
Before you get started, clone and bootstrap `vcpkg`:
80+
By default, the dependencies will be downloaded and built on demand. Optionally, you can prebuild the dependencies in advance:
7081

7182
```cmd
72-
git clone https://github.com/microsoft/vcpkg
73-
vcpkg\bootstrap-vcpkg.bat
83+
S:\vcpkg\vcpkg install curl icu libxml2 sqlite3 zlib --triplet=x64-windows
7484
```
7585

7686
## Set up Visual Studio integration (re-run on Visual Studio upgrades)
@@ -171,7 +181,7 @@ cmake --build S:\b\1
171181
>
172182
> Linking with debug information is very memory-intensive and may drastically slow down the linking process. A single link job is possible to consume upwards of 10 GiB of RAM. You can append `-D LLVM_PARALLEL_LINK_JOBS=N` to reduce the number of parallel link operations to `N` which should help reduce the memory pressure.
173183
174-
> **NOTE:** By default, we enables all the experimental features in Swift by `-D SWIFT_ENABLE_EXPERIMENTAL_{FEATURE}=YES`. These features can be disabled separately. Notice that `Concurrency` is an accepted language feature that should be enabled for Swift 5.5+.
184+
> **NOTE:** By default, we enables all the experimental features in Swift by `-D SWIFT_ENABLE_EXPERIMENTAL_{FEATURE}=YES`. Notice that `Concurrency` is an accepted language feature that should be enabled for Swift 5.5+.
175185
176186
Test Swift:
177187

0 commit comments

Comments
 (0)