Skip to content

Commit 44eb68b

Browse files
committed
README: document how to build swift-driver on Windows
Although the toolchain distribution builds use CMake to build on Windows (for bootstrapping the toolchain distribution), the development of swift-driver on Windows requires building with swift-package-manager. Update the documentation to explain how to build on Windows.
1 parent 1a7cde9 commit 44eb68b

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,30 @@ The `swift-driver` project is a new implementation of the Swift compiler driver
1313

1414
**Note:** Currently, swift-driver is only compatible with trunk development snapshots from [swift.org](https://swift.org/download/#snapshots).
1515

16-
The preferred way to build `swift-driver` is to use the Swift package manager:
16+
The preferred way to build `swift-driver` is to use the Swift package manager.
17+
18+
On most platforms you can build using:
1719

1820
```
1921
$ swift build
2022
```
2123

24+
However, on Windows, some additional work must be done by the developer.
25+
26+
Due to the default version of swift-tools-support-core that `Package.resolved` references, we must first update the package dependencies.
27+
28+
```
29+
swift package update
30+
```
31+
32+
Then, we can build the package using:
33+
34+
```cmd
35+
swift build -Xcc -I -Xcc "%SystemDrive%\Library\sqlite-3.38.0\usr\include" -Xlinker -L -Xlinker "%SystemDrive%\Library\sqlite-3.38.0\usr\lib" -Xlinker "%SDKROOT%\usr\lib\swift\windows\x86_64\swiftCore.lib"
36+
```
37+
38+
Because SQLite3 is a system library dependency, and there is no singular header and library search path, the developer must specify that. The path to SQLite3 may need to be adjusted if the library is not located at the specified location. Additionally, because Swift Package Manager does not differentiate between C/C++ and Swift targets and uses the Swift driver as the linker driver we must link in the Swift runtime into all targets manually.
39+
2240
To use `swift-driver` in place of the existing Swift driver, create a symbolic link from `swift` and `swiftc` to `swift-driver`:
2341

2442
```

0 commit comments

Comments
 (0)