Skip to content

Commit ab581a2

Browse files
authored
Merge pull request #7248 from apple/hughbe-patch-1
Add documentation for generating a Visual Studio project on Windows
2 parents 5d2a185 + e70c9f1 commit ab581a2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/Windows.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@ popd
136136
cmake --build "%swift_source_dir%/build/Ninja-DebugAssert/swift-windows-amd64/ninja"
137137
```
138138

139+
- To create a VisualStudio project, you'll need to change the generator and, if you have a 64 bit processor, specify the generator platform. Note that you may get multiple build errors compiling the `swift` project due to an MSBuild limitation that file paths cannot exceed 260 characters. These can be ignored, as they occur after the build, writing the last build status to a file.
140+
```
141+
cmake -G "Visual Studio 14" "%swift_source_dir%/swift"^
142+
-DCMAKE_GENERATOR_PLATFORM="x64"^
143+
...
144+
```
145+
139146
## Clang-cl
140147

141148
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.
@@ -146,7 +153,6 @@ Follow the instructions for MSVC, but add the following lines to each CMake conf
146153
-DCMAKE_LINKER="<path-to-llvm-bin>/lld-link.exe"^
147154
```
148155

149-
150156
## Windows Subsystem for Linux (WSL)
151157
- Note that all compiled Swift binaries are only executable within Bash on Windows and are Ubuntu, not Windows, executables.
152158
- Make sure to run all commands from Bash, or the project won't compile.

0 commit comments

Comments
 (0)