Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add windows CI #6

Merged
merged 14 commits into from Oct 11, 2021
Merged

Add windows CI #6

merged 14 commits into from Oct 11, 2021

Conversation

ctreffs
Copy link
Owner

@ctreffs ctreffs commented Jun 24, 2021

@ctreffs ctreffs self-assigned this Jun 24, 2021
@ctreffs ctreffs added enhancement New feature or request help wanted Extra attention is needed labels Jun 24, 2021
@pcbeard
Copy link
Contributor

pcbeard commented Sep 15, 2021

I used vcpkg (installed at C:\dev\vcpkg) to build SDL last night, and it does seem like a reasonable way to automate these builds. What I don't quite understand yet is whether it can provide equivalent pkg-config functionality. I did notice that you can install a version of dpkgconfig using vcpkg.

Looking at your build failure, it seems that vcpkg doesn't actually put built products into the path like homebrew does. You have to sort of know where the built-products go, which is a pain.

Trying to debug why swift build is failing on windows, I looked at swift build --verbose on Debian. As part of its output, it prints out the line:

pkg-config --variable pc_path pkg-config

If I run that on Debian, it prints out the default path that is being used to find .pc files:

pkg-config --variable pc_path pkg-config
/home/linuxbrew/.linuxbrew/lib/pkgconfig:/home/linuxbrew/.linuxbrew/share/pkgconfig:/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/os/linux/pkgconfig

Running it on Windows:

 pkgconf --variable pc_path pkg-config
../lib/pkgconfig;../share/pkgconfig

I wonder if Swift build is trying to do something with these paths, and failing on Windows. The result of pkgconf with sdl2 looks fine however:

 pkgconf --cflags sdl2
-IC:/dev/vcpkg/installed/x64-windows/include/SDL2

As a further experiment, if you look in my branch vcpkg-sdl, you'll see I'm hard coding the paths for the Windows headers as installed by vcpkg. With these steps I am able to get CSDL2 to build. However, if I try to run the tests, they don't run. Presumably because they aren't finding the .dll at runtime.

Confirmed, if I hand copy /dev/vcpkg/installed/x64-windows/bin/SDL2.dll into the debug directory, then the tests run.

@pcbeard
Copy link
Contributor

pcbeard commented Sep 16, 2021

Since SPM support for pkg-config on Windows seems to be hosed (using local git repos also seems weirdly broken too), I move that we write a script to generate the shim.h file, using the output of pkg-config --variable includedir. We'll also want to copy the .lib and .dll files into the .build/<configuration> directory.

@ctreffs
Copy link
Owner Author

ctreffs commented Oct 11, 2021

PR adds windows CI without really resting this package.
#9 will provide the implementation for that.

@ctreffs ctreffs enabled auto-merge (squash) October 11, 2021 14:18
@ctreffs ctreffs merged commit b6a58e8 into master Oct 11, 2021
@ctreffs ctreffs deleted the windows-ci branch October 11, 2021 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants