Skip to content
New issue

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

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

Already on GitHub? # to your account

Use official dev binaries/libraries for supported targets #15

Open
JerwuQu opened this issue Feb 5, 2025 · 3 comments
Open

Use official dev binaries/libraries for supported targets #15

JerwuQu opened this issue Feb 5, 2025 · 3 comments

Comments

@JerwuQu
Copy link

JerwuQu commented Feb 5, 2025

For some targets like x86_64-pc-windows-gnu there are official built development binaries and libraries (like SDL3-devel-3.x.y-mingw.tar.gz) that can be used directly with sdl3-sys.
Could these pulled and linked to automatically through a crate feature? This would simplify getting started with this crate for new users.
I also understand if you prefer delegating finding of libs to pkg-config and vcpkg though.

@JerwuQu JerwuQu changed the title Use official dev binaries for supported targets Use official dev binaries/libraries for supported targets Feb 5, 2025
@Lokathor
Copy link

Lokathor commented Feb 5, 2025

I suspect the answer starts with "yes" and then continues "but most people don't use the gnu target anyway".

If there's an official dev binary for the msvc target, that could have a big impact.

@JerwuQu
Copy link
Author

JerwuQu commented Feb 5, 2025

If there's an official dev binary for the msvc target, that could have a big impact.

Yes, it's SDL3-devel-3.x.y-VC.zip in releases.

@maia-s
Copy link
Owner

maia-s commented Feb 6, 2025

I could add a feature for this, but I don't want to maintain binary crates, and the VC zip is too big for the standard crate size limit anyway (10MB). The feature could enable downloading the required file at build time, but that's considered very bad behaviour by some. As far as I know cargo has no way for a crate to specify non-crate dependencies, so it'd have to be done in the build script. I couldn't find a crate that makes it easy with caching and checksumming so I'd have to implement that (in particular caching seems important as otherwise you'd end up downloading these files over again every time the build hash changes. e: on second thought the build hash of sdl3-sys shouldn't change so maybe this isn't necessary, but it'd get redownloaded after a cargo clean without it). and extraction code too.

I wonder how much this would be used if we added it. mingw has a package manager in msys2 that installs pkg-config configs and msvc has vcpkg.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants