I've been able to build the swift-package-manager project easily on macOS and Debian (WSL) by simply checking out a tag (e.g.
swift-5.5-RELEASE) and running swift build. No such luck on Windows. It gets about 50 files in, and quits here:
D:\Swift\swift-package-manager\.build\checkouts\swift-llbuild\lib\Core\SQLiteBuildDB.cpp:28:10: fatal error: 'sqlite3.h' file not found #include <sqlite3.h> ^~~~~~~~~~~ 1 error generated.
I have sqlite3 installed on my system in using vcpkg. To find out where the headers are installed, I tried
pkgconf --cflags sqlite3 which output:
So I tried:
swift build -Xcc -IC:/dev/vcpkg/installed/x64-windows/include
As expected, this got to a point where it couldn't find the sqlite3 library.
pkgconf --libs tells me:
So I tried this:
swift build -Xcc -IC:/dev/vcpkg/installed/x64-windows/include -Xlinker -LC:/dev/vcpkg/installed/x64-windows/lib
And the build completes successfully. For it to actually run, I have to copy sqlite3.dll into the .build/debug directory. What changes would be necessary to make these flags unnecessary? Does SPM support discovering C flags and linker flags using pkgconf on Windows?