@@ -17,11 +17,11 @@ export VCToolsInstallDir=".../Microsoft Visual Studio/2017/Community"
17
17
```
18
18
19
19
## 2. Set up the ` visualc ` and ` ucrt ` modules
20
- The ` visualc.modulemap ` located at
21
- ` swift/stdlib/public/Platform/visualc.modulemap ` needs to be copied into
22
- ` ${VCToolsInstallDir}/include ` . The ` ucrt.modulemap ` located at
20
+ The ` ucrt.modulemap ` located at
23
21
` swift/stdlib/public/Platform/ucrt.modulemap ` needs to be copied into
24
- ` ${UniversalCRTSdkDir}/Include/${UCRTVersion}/ucrt ` .
22
+ ` ${UniversalCRTSdkDir}/Include/${UCRTVersion}/ucrt ` . The ` visualc.modulemap `
23
+ located at ` swift/stdlib/public/Platform/visualc.modulemap ` needs to be copied
24
+ into ` ${VCToolsInstallDir}/include ` .
25
25
26
26
## 3. Configure the runtime to be built with the just built ` clang `
27
27
Ensure that we use the tools from the just built LLVM and ` clang ` tools to
@@ -32,13 +32,35 @@ build the static libraries. Note that cross-compiling will require the use of
32
32
` lld ` . Ensure that ` lld-link.exe ` is available to clang via your path.
33
33
Additionally, the ICU headers and libraries need to be provided for the build.
34
34
35
+ #### macOS
36
+
35
37
``` bash
36
- --extra-cmake-options=-DSWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER=FALSE, \
37
- -DCMAKE_AR=< path to llvm-ar> , \
38
- -DCMAKE_RANLIB=< path to llvm-ranlib> , \
39
- -DSWIFT_SDKS=WINDOWS, \
40
- -DSWIFT_WINDOWS_ICU_I18N_INCLUDE =< path to ICU i18n includes> , \
41
- -DSWIFT_WINDOWS_ICU_UC_INCLUDE =< path to ICU UC includes> , \
42
- -DSWIFT_WINDOWS_ICU_I18N =< path to ICU i18n lib> , \
43
- -DSWIFT_WINDOWS_ICU_UC =< path to ICU UC lib>
38
+ --extra-cmake-options=-DSWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER=FALSE,\
39
+ -DCMAKE_AR=< path to llvm-ar> ,\
40
+ -DCMAKE_RANLIB=< path to llvm-ranlib> ,\
41
+ -DSWIFT_SDKS=WINDOWS,\
42
+ -DSWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE =< path to ICU i18n includes> ,\
43
+ -DSWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE =< path to ICU UC includes> ,\
44
+ -DSWIFT_WINDOWS_x86_64_ICU_I18N =< path to ICU i18n lib> ,\
45
+ -DSWIFT_WINDOWS_x86_64_ICU_UC =< path to ICU UC lib>
44
46
```
47
+
48
+ #### Linux
49
+
50
+ For Linux, you will also need to build the Linux SDK with the cmake options
51
+ below.
52
+
53
+ ``` bash
54
+ --extra-cmake-options=-DSWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER=FALSE,\
55
+ -DCMAKE_AR=< path to llvm-ar> ,\
56
+ -DCMAKE_RANLIB=< path to llvm-ranlib> ,\
57
+ -DSWIFT_SDKS=' LINUX;WINDOWS' ,\
58
+ -DSWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE=< path to ICU i18n includes> ,\
59
+ -DSWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE=< path to ICU UC includes> ,\
60
+ -DSWIFT_WINDOWS_x86_64_ICU_I18N=< path to ICU i18n lib> ,\
61
+ -DSWIFT_WINDOWS_x86_64_ICU_UC=< path to ICU UC lib>
62
+ ```
63
+
64
+ ## 4. Build the Swift runtime and standard library with ` ninja `
65
+ From the build directory, you can build the Swift runtime and standard library
66
+ for Windows using ` ninja swiftCore-windows-x86_64 ` .
0 commit comments