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/Windows.md
+108-1Lines changed: 108 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,114 @@ Additionally, the ICU headers and libraries need to be provided for the build.
38
38
```
39
39
40
40
## MSVC
41
-
To be filled in.
41
+
- Windows doesn't currently have a build script. You'll need to run commands manually to build Swift on Windows.
42
+
- Release/RelWithDebInfo modes have not been tested and may not be supported.
43
+
- Windows support for Swift is very much a WIP, and may not work on your system.
44
+
45
+
### 1. Install dependencies
46
+
- Make sure to add Python, CMake and Ninja to your `Path` environment variable
47
+
1. Latest version (2.7.12 tested) of [Python 2](https://www.python.org/downloads/)
48
+
2. Latest version (3.7.0-rc3 tested) of [CMake](https://cmake.org/download/)
49
+
3. Latest version (1.7.1 tested) of [Ninja](https://github.com/ninja-build/ninja/releases/latest)
50
+
4. Latest version (2015 Update 3 tested) of [Visual Studio](https://www.visualstudio.com/downloads/)
51
+
- Make sure to include `Programming Languages|Visual C++`, and `Windows and Web Development|Universal Windows App Development|Windows SDK` in your installation.
52
+
- Windows SDK 10.0.10240 was tested. Some later versions (e.g. 10.0.14393) are known not to work, as they are not supported by `compiler-rt`.
53
+
54
+
### 2. Clone the repositories
55
+
1. Create a folder to contain all the Swift repositories
56
+
2.`apple/swift-cmark` into a folder named `cmark`
57
+
3.`apple/swift-clang` into a folder named `clang`
58
+
5.`apple/swift-llvm` into a folder named `llvm`
59
+
5.`apple/swift` into a folder named `swift`
60
+
- Currently, other repositories in the Swift project have not been tested, and may not be supported.
61
+
62
+
### 3. Build ICU
63
+
1. Download and extract the [ICU source code](http://site.icu-project.org/download) to a folder named `icu` in the same directory as the other Swift project repositories.
64
+
2. Open `src/win32/allinone.sln` in Visual Studio.
65
+
3. Make sure to select the correct architecture from the drop-down in Visual Studio.
66
+
4. Right click on the solution in the Solution Explorer window and select `Build Solution`.
67
+
5. When this is done, add the `<icu-source>/bin` folder to your `Path` environment variable.
68
+
69
+
### 4. Get ready
70
+
- From within a **developer** command prompt, execute the following command if you have an x64 PC.
71
+
```
72
+
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat" amd64
73
+
```
74
+
- Then adapt the following command, and run it.
75
+
```
76
+
set swift_source_dir=path-to-directory-containing-all-cloned-repositories
77
+
```
78
+
79
+
### 5. Build CMark
80
+
- This must be done from within a developer command prompt, and could take up to 10 minutes.
Follow the instructions for MSVC, but add the following lines to each CMake configuration command. We need to use LLVM's `lld-link.exe` linker, as MSVC's `link.exe` crashes due to corrupt PDB files using `clang-cl`. `Clang-cl` 3.9.0 has been tested.
0 commit comments