@@ -22,42 +22,42 @@ Windows.
22
22
manually to build Swift on Windows.
23
23
- Windows support for Swift is a work in progress and may not work on your
24
24
system, but it has been tested.
25
- - Using the latest Visual Studio version is recommended. Swift may fail to
26
- build with older C++ compilers.
25
+ - Using the latest Visual Studio version is recommended (tested with Visual
26
+ Studio 2017 - Version 15.5.5). Swift may fail to build with older C++
27
+ compilers.
27
28
28
29
### 1. Install dependencies
29
- - Make sure to add Python, CMake and Ninja to your ` Path ` environment variable
30
30
1 . Latest version (2.7.12 tested) of [ Python
31
31
2] ( https://www.python.org/downloads/ )
32
- 2 . Latest version (3.7.0-rc3 tested) of [ CMake] ( https://cmake.org/download/ )
33
- 3 . Latest version (1.7.1 tested) of
32
+ 1 . Latest version (3.7.0-rc3 tested) of [ CMake] ( https://cmake.org/download/ )
33
+ 1 . Latest version (1.7.1 tested) of
34
34
[ Ninja] ( https://github.com/ninja-build/ninja/releases/latest )
35
- 4 . Latest version (2015 Update 3 tested) of [ Visual
35
+ 1 . Latest version (2015 Update 3 tested) of [ Visual
36
36
Studio] ( https://www.visualstudio.com/downloads/ )
37
-
38
- - Make sure to include ` Programming Languages|Visual C++ ` and `Windows and Web
39
- Development|Universal Windows App Development|Windows SDK` in your
37
+ - Make sure to include "Programming Languages|Visual C++" and "Windows and Web
38
+ Development|Universal Windows App Development|Windows SDK" in your
40
39
installation.
40
+ - Make sure to add Python, CMake and Ninja to your ` Path ` environment variable
41
41
42
42
### 2. Clone the repositories
43
43
1 . Create a folder to contain all the Swift repositories
44
- 2 . ` apple/swift-cmark ` into a folder named ` cmark `
45
- 3 . ` apple/swift-clang ` into a folder named ` clang `
46
- 5 . ` apple/swift-llvm ` into a folder named ` llvm `
47
- 5 . ` apple/swift ` into a folder named ` swift `
44
+ 1 . Clone ` apple/swift-cmark ` into a folder named ` cmark `
45
+ 1 . Clone ` apple/swift-clang ` into a folder named ` clang `
46
+ 1 . Clone ` apple/swift-llvm ` into a folder named ` llvm `
47
+ 1 . Clone ` apple/swift ` into a folder named ` swift `
48
48
- Currently, other repositories in the Swift project have not been tested and
49
49
may not be supported.
50
50
51
51
### 3. Build ICU
52
52
1 . Download and extract the [ ICU source
53
53
code] ( http://site.icu-project.org/download ) to a folder named ` icu ` in the same
54
54
directory as the other Swift project repositories.
55
- 2 . Open ` src/win32/allinone.sln ` in Visual Studio.
56
- 3 . Make sure to select the correct architecture from the drop-down in Visual
55
+ 1 . Open ` src/win32/allinone.sln ` in Visual Studio.
56
+ 1 . Make sure to select the correct architecture from the drop-down in Visual
57
57
Studio.
58
- 4 . Right click on the solution in the Solution Explorer window and select
59
- ` Build Solution ` .
60
- 5 . When this is done, add the ` <icu-source>/bin ` folder to your ` Path `
58
+ 1 . Right click on the solution in the Solution Explorer window and select
59
+ " Build Solution" .
60
+ 1 . When this is done, add the ` <icu-source>/bin ` folder to your ` Path `
61
61
environment variable.
62
62
63
63
### 4. Get ready
@@ -68,7 +68,7 @@ environment variable.
68
68
``` cmd
69
69
VsDevCmd -arch=amd64
70
70
```
71
- If instead, you're compiling for a 32-bit Windows target, adapt the ` arch `
71
+ If instead you're compiling for a 32-bit Windows target, adapt the ` arch `
72
72
argument to ` x86 ` and run
73
73
``` cmd
74
74
VsDevCmd -arch=x86
@@ -92,8 +92,9 @@ cmake --build "%swift_source_dir%/build/Ninja-DebugAssert/cmark-windows-amd64/"
92
92
93
93
### 6. Build LLVM/Clang/Compiler-RT
94
94
- This must be done from within a developer command prompt. LLVM and Clang are
95
- large projects so building might take a few hours. Make sure that the build
96
- type (e.g. Debug/Release) for LLVM/Clang matches the build type for Swift.
95
+ large projects, so building might take a few hours. Make sure that the build
96
+ type (e.g. Debug, Release, RelWithDebInfoAssert) for LLVM/Clang matches the
97
+ build type for Swift.
97
98
- Optionally, you can omit building compiler-rt by removing all lines referring
98
99
to ` compiler-rt ` below, which should give faster build times.
99
100
``` cmd
@@ -120,7 +121,7 @@ cmake --build "%swift_source_dir%/build/Ninja-DebugAssert/llvm-windows-amd64"
120
121
two hours depending on your system.
121
122
- You may need to adjust the ` SWIFT_WINDOWS_LIB_DIRECTORY ` parameter depending on
122
123
your target platform or Windows SDK version.
123
- - While the commands here use MSVC to build, using clang-cl is recommended (see
124
+ - While the commands here use MSVC to build, using ` clang-cl ` is recommended (see
124
125
the ** Clang-cl** section below).
125
126
``` cmd
126
127
mkdir "%swift_source_dir%/build/Ninja-DebugAssert/swift-windows-amd64/ninja"
@@ -163,7 +164,7 @@ cmake -G "Visual Studio 15" "%swift_source_dir%/swift"^
163
164
## Clang-cl
164
165
165
166
Follow the instructions for MSVC, but add the following lines to each CMake
166
- configuration command. ` Clang -cl` 4.0.1 has been tested. You can remove the
167
+ configuration command. ` clang -cl` 4.0.1 has been tested. You can remove the
167
168
` SWIFT_BUILD_DYNAMIC_SDK_OVERLAY=FALSE ` definition, as overlays are supported
168
169
with ` clang-cl ` , as it supports modules. The ` Z7 ` flag is required to produce
169
170
PDB files that MSVC's ` link.exe ` can read and enables proper stack traces.
0 commit comments