Skip to content

Commit 6a8b1e2

Browse files
committed
docs/Windows: Format and clarify documentation
1 parent 9305156 commit 6a8b1e2

File tree

4 files changed

+41
-40
lines changed

4 files changed

+41
-40
lines changed

docs/Windows.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Linux.
77

88
Currently there are three supported ways to build Swift for Windows.
99

10-
1. To cross-compile Swift for Windows from another host Operating System (using
10+
1. To cross-compile Swift for Windows from another host operating system (using
1111
`clang`), see [Cross Compiling for Windows](./WindowsCrossCompile.md)
1212

1313
1. To build on Windows using `clang-cl`, see [Building on
@@ -18,7 +18,7 @@ Currently there are three supported ways to build Swift for Windows.
1818

1919
`clang-cl` is recommended over MSVC for building Swift on Windows.
2020
Although it is possible to build the compiler and the standard library with
21-
MSVC, and use those built products to compile a Swift program, it won't be
21+
MSVC to use those built products to compile a Swift program, it won't be
2222
possible to run the binary without seperately obtaining the Swift runtime. On
2323
the other hand, `clang-cl` is able to build the runtime, which makes it
2424
possible to build and run all the components required for Swift natively on
@@ -28,5 +28,5 @@ Windows.
2828

2929
On the [Windows Subsystem for
3030
Linux](https://docs.microsoft.com/en-us/windows/wsl/about), it's possible to
31-
build and run Swift in a Linux-like enviroment, on Windows. See [the
32-
doc](./WindowsSubsystemForLinux.md) for details
31+
build and run Swift in a Linux-like environment, on Windows. See [Getting
32+
Started with Swift on Windows](./WindowsSubsystemForLinux.md) for details.

docs/WindowsBuild.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,42 +22,42 @@ Windows.
2222
manually to build Swift on Windows.
2323
- Windows support for Swift is a work in progress and may not work on your
2424
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.
2728

2829
### 1. Install dependencies
29-
- Make sure to add Python, CMake and Ninja to your `Path` environment variable
3030
1. Latest version (2.7.12 tested) of [Python
3131
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
3434
[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
3636
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
4039
installation.
40+
- Make sure to add Python, CMake and Ninja to your `Path` environment variable
4141

4242
### 2. Clone the repositories
4343
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`
4848
- Currently, other repositories in the Swift project have not been tested and
4949
may not be supported.
5050

5151
### 3. Build ICU
5252
1. Download and extract the [ICU source
5353
code](http://site.icu-project.org/download) to a folder named `icu` in the same
5454
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
5757
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`
6161
environment variable.
6262

6363
### 4. Get ready
@@ -68,7 +68,7 @@ environment variable.
6868
```cmd
6969
VsDevCmd -arch=amd64
7070
```
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`
7272
argument to `x86` and run
7373
```cmd
7474
VsDevCmd -arch=x86
@@ -92,8 +92,9 @@ cmake --build "%swift_source_dir%/build/Ninja-DebugAssert/cmark-windows-amd64/"
9292

9393
### 6. Build LLVM/Clang/Compiler-RT
9494
- 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.
9798
- Optionally, you can omit building compiler-rt by removing all lines referring
9899
to `compiler-rt` below, which should give faster build times.
99100
```cmd
@@ -120,7 +121,7 @@ cmake --build "%swift_source_dir%/build/Ninja-DebugAssert/llvm-windows-amd64"
120121
two hours depending on your system.
121122
- You may need to adjust the `SWIFT_WINDOWS_LIB_DIRECTORY` parameter depending on
122123
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
124125
the **Clang-cl** section below).
125126
```cmd
126127
mkdir "%swift_source_dir%/build/Ninja-DebugAssert/swift-windows-amd64/ninja"
@@ -163,7 +164,7 @@ cmake -G "Visual Studio 15" "%swift_source_dir%/swift"^
163164
## Clang-cl
164165

165166
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
167168
`SWIFT_BUILD_DYNAMIC_SDK_OVERLAY=FALSE` definition, as overlays are supported
168169
with `clang-cl`, as it supports modules. The `Z7` flag is required to produce
169170
PDB files that MSVC's `link.exe` can read and enables proper stack traces.

docs/WindowsCrossCompile.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Cross-compiling Swift for Windows with `clang`.
1+
# Cross-compiling Swift for Windows with `clang`
22

33
This document describes how to cross compile Swift on Windows on a non-Windows
44
host. For more context on the status of Swift on Windows in general, see
5-
[the Windows doc](./Windows.md)
5+
[Getting Started with Swift on Windows](./Windows.md)
66

7-
## 1. Setup Visual Studio Environment Variables
7+
## 1. Set up Visual Studio environment variables
88
Building for Windows requires that the Visual Studio environment variables are
99
setup similar to the values on Windows. Currently, the runtime has been tested
1010
to build against the Windows 10 SDK at revision 10.10.586.
@@ -16,20 +16,20 @@ export UniversalCRTSdkDir=".../Windows Kits/10"
1616
export VCToolsInstallDir=".../Microsoft Visual Studio/2017/Community"
1717
```
1818

19-
## 2. Setup `visualc` and `ucrt` modules
19+
## 2. Set up the `visualc` and `ucrt` modules
2020
The `visualc.modulemap` located at
2121
`swift/stdlib/public/Platform/visualc.modulemap` needs to be copied into
2222
`${VCToolsInstallDir}/include`. The `ucrt.modulemap` located at
2323
`swift/stdlib/public/Platform/ucrt.modulemap` needs to be copied into
2424
`${UniversalCRTSdkDir}/Include/${UCRTVersion}/ucrt`.
2525

26-
## 3. Configure the runtime to be built with the just built clang
27-
Ensure that we use the tools from the just built LLVM and clang tools to build
28-
the Windows SDK. You will need to pass a few extra options to cmake via the
29-
`build-script` invocation to achieve this. You will need to expand out the
30-
path where llvm-ar and llvm-ranlib are built. These are needed to correctly
26+
## 3. Configure the runtime to be built with the just built `clang`
27+
Ensure that we use the tools from the just built LLVM and `clang` tools to
28+
build the Windows SDK. You will need to pass a few extra options to cmake via
29+
the `build-script` invocation to achieve this. You will need to expand out the
30+
path where `llvm-ar` and `llvm-ranlib` are built. These are needed to correctly
3131
build the static libraries. Note that cross-compiling will require the use of
32-
lld. Ensure that lld-link.exe (lld-link) is available to clang via your path.
32+
`lld`. Ensure that `lld-link.exe` is available to clang via your path.
3333
Additionally, the ICU headers and libraries need to be provided for the build.
3434

3535
```bash

docs/WindowsSubsystemForLinux.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ are identical to the Ubuntu dependencies, with the addition of `make`.
2020
sudo apt-get install git make cmake ninja-build clang python uuid-dev libicu-dev icu-devtools libbsd-dev libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config libblocksruntime-dev libcurl4-openssl-dev
2121
```
2222

23-
### 3. Upgrade clang
24-
Install a version of clang with C++ 14 support - the default version of clang
23+
### 3. Upgrade `clang`
24+
Install a version of `clang` with C++ 14 support; the default version of `clang`
2525
on WSL results in linker errors during compilation.
2626
```bash
2727
sudo apt-get install clang-3.6
@@ -30,7 +30,7 @@ sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.6
3030
```
3131

3232
### 4. Upgrade CMake
33-
Install the latest version of CMake - Swift uses new CMake features such as
33+
Install the latest version of CMake; Swift uses new CMake features such as
3434
`IN_LIST` and won't build without these features.
3535
```bash
3636
wget http://www.cmake.org/files/v3.6/cmake-3.6.2.tar.gz

0 commit comments

Comments
 (0)