Skip to content

Commit 887019a

Browse files
authored
Update WindowsBuild.md
Add instructions for building libxml2. The libxml2 available for Windows is built against MinGW and requires iconv support. Simply build our own version of libxml2 to avoid the dependency.
1 parent cca6fea commit 887019a

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

docs/WindowsBuild.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ it provides some of the needed headers and libraries.
4141
1. Clone `apple/swift-corelibs-foundation` into a folder named `swift-corelibs-foundation`
4242
1. Clone `apple/swift-corelibs-xctest` into a folder name `swift-corelibs-xctest`
4343
1. Clone `apple/swift-lldb` into a folder named `lldb`
44+
1. Clone `libxml2` into a folder named `libxml2`
4445

4546
- Currently, other repositories in the Swift project have not been tested and
4647
may not be supported.
@@ -63,6 +64,7 @@ git clone https://github.com/apple/swift-corelibs-libdispatch
6364
git clone https://github.com/apple/swift-corelibs-foundation
6465
git clone https://github.com/apple/swift-corelibs-xctest
6566
git clone https://github.com/apple/swift-lldb lldb
67+
git clone https://gitlab.gnome.org/GNOME/libxml2.git libxml2
6668
```
6769

6870
### 3. Acquire ICU
@@ -242,11 +244,19 @@ popd
242244
cmake --build S:\b\libdispatch
243245
```
244246

245-
### 11. Build swift-corelibs-foundation
247+
### 11. Build libxml2
248+
249+
```cmd
250+
pushd "S:\libxml2\win32"
251+
cscript configure.js iconv=no
252+
nmake /f Makefile.msvc
253+
popd
254+
```
255+
256+
### 12. Build swift-corelibs-foundation
246257

247258
To build Foundation you will need builds of:
248259

249-
- `libxml2` (http://xmlsoft.org, download and unzip the Windows prebuilt or build your own)
250260
- `libcurl` (https://curl.haxx.se, download the source, `cd` into `winbuild`, and run `nmake /f Makefile.vc mode=static VC=15 MACHINE=x64`)
251261

252262
```cmd
@@ -269,7 +279,7 @@ cmake -G Ninja^
269279
270280
```
271281

272-
### 12. Build swift-corelibs-xctest
282+
### 13. Build swift-corelibs-xctest
273283

274284
```cmd
275285
mkdir "S:\b\xctest"
@@ -286,7 +296,7 @@ popd
286296
cmake --build S:\b\xctest
287297
```
288298

289-
### 13. Install Swift on Windows
299+
### 14. Install Swift on Windows
290300

291301
- Run ninja install:
292302

0 commit comments

Comments
 (0)