You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/WindowsBuild.md
+24-14Lines changed: 24 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
3
3
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.
4
4
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.
6
6
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).
8
8
9
9
## Install dependencies
10
10
@@ -24,53 +24,63 @@ vs_community ^
24
24
del /q vs_community.exe
25
25
```
26
26
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
+
27
31
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.
28
32
29
33
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.
30
34
31
35
### Python
32
36
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)*.
34
38
35
39
If you are building a debug version of Swift, you should also install the Python debug binaries.
36
40
37
41
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
39
43
3. Click *Modify*, then *Yes*, then *Modify* again and then *Next*
40
44
4. Select *Download debug binaries (requires VS 2015 or later)*
41
45
5. Click *Install*
42
46
43
47
## Enable Developer Mode
44
48
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.
46
50
47
51
## Clone the repositories
48
52
49
53
> **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: <pathtosources>
54
+
>
55
+
> subst S: <path to sources>
51
56
52
57
First, clone `apple/swift` (this repository) with Git:
## Set up Visual Studio integration (re-run on Visual Studio upgrades)
@@ -171,7 +181,7 @@ cmake --build S:\b\1
171
181
>
172
182
> 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.
173
183
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+.
0 commit comments