|
1 | 1 | # Building Swift on Windows
|
2 | 2 |
|
3 |
| -Visual Studio 2017 or newer is needed to build swift on Windows. |
| 3 | +Visual Studio 2017 or newer is needed to build Swift on Windows. |
4 | 4 |
|
5 |
| -The following must take place in the **developer command prompt** (provided by Visual Studio). This shows up as "x64 Native Tools Command Prompt for VS2017" (or VS2019, VS2019 Preview depending on the Visual Studio that you are using) in the Start Menu. |
| 5 | +The commands below (with the exception of installing Visual Studio) must be entered in the "**x64 Native** Tools Command Prompt for VS2017" (or VS2019, VS2019 Preview 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 | 7 | ## Install dependencies
|
8 | 8 |
|
9 |
| -- Install the latest version of [Visual Studio](https://www.visualstudio.com/downloads/) |
10 |
| -- Make sure to include "Programming Languages|Visual C++" and "Windows and Web Development|Universal Windows App Development|Windows SDK" in your installation. The following components are required: |
| 9 | +### Visual Studio |
11 | 10 |
|
12 |
| -1. Microsoft.VisualStudio.Component.Windows10SDK |
13 |
| -2. Microsoft.VisualStudio.Component.Windows10SDK.17763 |
14 |
| -3. Microsoft.VisualStudio.Component.VC.Tools.x86.x64 |
| 11 | +An easy way to get most of the tools to build Swift is using the [Visual Studio installer](https://www.visualstudio.com/downloads/). This command installs all needed Visual Studio components as well as Python and Git: |
| 12 | + |
| 13 | +``` |
| 14 | +vs_community ^ |
| 15 | + --add Component.CPython2.x86 ^ |
| 16 | + --add Component.CPython3.x64 ^ |
| 17 | + --add Microsoft.VisualStudio.Component.Git ^ |
| 18 | + --add Microsoft.VisualStudio.Component.VC.ATL ^ |
| 19 | + --add Microsoft.VisualStudio.Component.VC.CMake.Project ^ |
| 20 | + --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ^ |
| 21 | + --add Microsoft.VisualStudio.Component.Windows10SDK ^ |
| 22 | + --add Microsoft.VisualStudio.Component.Windows10SDK.17763 |
| 23 | +``` |
| 24 | + |
| 25 | +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. |
15 | 26 |
|
16 | 27 | 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.
|
17 | 28 |
|
18 | 29 | ### Python
|
19 | 30 |
|
20 |
| -In the Visual Studio installation program, under *Individual Components* |
| 31 | +The command above already installs Python 2 and 3. Alternatively, in the Visual Studio installation program, under *Individual Components* |
21 | 32 |
|
22 | 33 | 1. Install *Python 2*, either the 32-bit version (C:\Python27\\) or the 64-bit version (C:\Python27amd64\\)
|
23 | 34 |
|
|
0 commit comments