Skip to content

Commit 962f68d

Browse files
authored
Update WindowsBuild.md
Corrections and improvements to the documentation to build on Windows. This includes: - switching to `cl` for the swift build - setting up the paths correctly - correcting the instructions for XCTest builds - setup to ensure that XCTest can be tested in the future - fixes to actually get the swift tests to run on Windows - removal of unnecessary arguments to libdispatch build
1 parent 86b7436 commit 962f68d

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

docs/WindowsBuild.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ mkdir "S:\b\swift"
159159
pushd "S:\b\swift"
160160
cmake -G Ninja^
161161
-DCMAKE_BUILD_TYPE=RelWithDebInfo^
162-
-DCMAKE_C_COMPILER=clang-cl^
163-
-DCMAKE_CXX_COMPILER=clang-cl^
162+
-DCMAKE_C_COMPILER=cl^
163+
-DCMAKE_CXX_COMPILER=cl^
164164
-DCMAKE_EXE_LINKER_FLAGS:STRING="/INCREMENTAL:NO"^
165165
-DCMAKE_SHARED_LINKER_FLAGS:STRING="/INCREMENTAL:NO"^
166166
-DSWIFT_INCLUDE_DOCS=OFF^
@@ -220,9 +220,9 @@ Running the testsuite on Windows has additional external dependencies. You must
220220
2. diffutils
221221
3. grep
222222
4. sed
223-
223+
224224
```cmd
225-
path S:\b\swift\bin;S:\b\swift\libdispatch-prefix\bin;%PATH%;%ProgramFiles(x86)%\GnuWin32\bin;S:\thirdparty\icu4c-63_1-Win64-MSVC2017\lib64
225+
path S:\thirdparty\icu4c-63_1-Win64-MSVC2017\bin64;S:\b\swift\bin;S:\b\swift\libdispatch-prefix\bin;%PATH%;%ProgramFiles(x86)%\GnuWin32\bin
226226
ninja -C S:\b\swift check-swift
227227
```
228228

@@ -236,14 +236,18 @@ cmake -G Ninja^
236236
-DCMAKE_C_COMPILER=clang-cl^
237237
-DCMAKE_CXX_COMPILER=clang-cl^
238238
-DCMAKE_SWIFT_COMPILER=S:\b\swift\bin\swiftc.exe^
239-
-DSwift_DIR=S:\b\swift\lib\cmake\swift^
240239
-DENABLE_SWIFT=ON^
241240
-DENABLE_TESTING=OFF^
242241
S:\swift-corelibs-libdispatch
243242
popd
244243
cmake --build S:\b\libdispatch
245244
```
246245

246+
- Add libdispatch to your path:
247+
```cmd
248+
path S:\b\libdispatch;S:\b\libdispatch\src;%PATH%
249+
```
250+
247251
### 11. Build libxml2
248252

249253
```cmd
@@ -279,23 +283,36 @@ cmake -G Ninja^
279283
280284
```
281285

286+
- Add Foundation to your path:
287+
```cmd
288+
path S:\b\foundation;%PATH%
289+
```
290+
282291
### 13. Build swift-corelibs-xctest
283292

284293
```cmd
285294
mkdir "S:\b\xctest"
286295
pushd "S:\b\xctest"
287-
cmke -G Ninja^
296+
cmake -G Ninja^
297+
-DBUILD_SHARED_LIBS=YES^
288298
-DCMAKE_BUILD_TYPE=RelWithDebInfo^
289299
-DCMAKE_SWIFT_COMPILER=S:\b\swift\bin\swiftc.exe^
290300
-DXCTEST_PATH_TO_COREFOUNDATION_BUILD=S:\b\foundation\CoreFoundation-prefix^
291301
-DXCTEST_PATH_TO_FOUNDATION_BUILD=S:\b\foundation^
292-
-DXCTEST_PATH_TO_LIBDPATCH_SOURCE=S:\b\swift-corelibs-libdispatch^
302+
-DXCTEST_PATH_TO_LIBDISPATCH_SOURCE=S:\swift-corelibs-libdispatch^
293303
-DXCTEST_PATH_TO_LIBDISPATCH_BUILD=S:\b\libdispatch^
304+
-DLIT_COMMAND=S:\llvm\utils\lit\lit.py^
305+
-DPYTHON_EXECUTABLE=C:\Python27\python.exe^
294306
S:\swift-corelibs-xctest
295307
popd
296308
cmake --build S:\b\xctest
297309
```
298310

311+
- Add XCTest to your path:
312+
```cmd
313+
path S:\b\xctest;%PATH%
314+
```
315+
299316
### 14. Install Swift on Windows
300317

301318
- Run ninja install:

0 commit comments

Comments
 (0)