Closed
Description
It's currently hard to build SwiftSDL2 on Windows.
In fact on CI it is not working for now (https://github.com/ctreffs/SwiftSDL2/actions/workflows/ci-windows.yml).
The idea is to:
- install SDL2 via vcpkg
- install pkfconf via vcpkg
- setup the required environment
- let SPM handle the includes and lib linking for the build
As of Swift 5.8 everything for this should be in place.
For macOS (brew) and Linux (apt) this way works for ages.
For now it does not however for the Windows platform.
Resources:
- PackageLoading: support non-Unix platforms for PkgConfig swiftlang/swift-package-manager#5517
- PackageLoading: further portability changes for pkg-config swiftlang/swift-package-manager#5527
- https://forums.swift.org/t/importing-c-libraries-on-windows/60547
- https://forums.swift.org/t/how-to-build-spm-on-windows/52600/
- https://forums.swift.org/t/include-path-of-systemlibrary-on-windows-without-pkg-config/52898
- [SR-15357] [SwiftPM] support for vcpkg swiftlang/swift-package-manager#4381
- [build-windows-toolchain] Build dependencies with
vcpkg
swiftlang/swift#60679