Skip to content

Commit f40b207

Browse files
authored
Merge pull request swiftlang#32057 from MForster/m/windows
Improve windows build instructions.
2 parents 4f4c90b + 5f9225f commit f40b207

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

docs/WindowsBuild.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
11
# Building Swift on Windows
22

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.
44

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.
66

77
## Install dependencies
88

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
1110

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.
1526

1627
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.
1728

1829
### Python
1930

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*
2132

2233
1. Install *Python 2*, either the 32-bit version (C:\Python27\\) or the 64-bit version (C:\Python27amd64\\)
2334

0 commit comments

Comments
 (0)