Skip to content

sdl2-sys build should pass a version range to pkg-config #1061

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

Open
LunarLambda opened this issue Dec 25, 2020 · 1 comment
Open

sdl2-sys build should pass a version range to pkg-config #1061

LunarLambda opened this issue Dec 25, 2020 · 1 comment

Comments

@LunarLambda
Copy link
Contributor

LunarLambda commented Dec 25, 2020

The bundled feature exists to allow building SDL2 from source on systems that do not provide the correct version of SDL2 (i.e. LTS systems with <= 2.0.5) [citation needed]

However, there are currently no guards in place to make sure building against a native SDL2 fails if versions don't match. Likely, the user will get a confusing linker error, and be none the wiser.

The pkg-config crate allows specifying a range of acceptable versions using the atleast_version, exactly_version, and range_version methods on Config.

This should be added to computer_include_paths and pkg_config_print.

If the pkg-config probe returns Error::Failure, we should print the message, and suggest to try using the bundled feature, noting that it will require cmake.

Additionally, note that the versions of SDL2_image, SDL2_ttf, SDL2_mixer, and SDL2_gfx are not linked to the version of SDL2. This means we need to either skip this check for them, or figure out which versions we are currently expecting.

Note about vcpkg

vcpkg currently does not support version selection. The vcpkg crate does not provide a way to query the found version, either. When the vcpkg sdl2 port eventually updates to 2.0.14, users may (but in theory, shouldn't?) run into build failures.

@LunarLambda
Copy link
Contributor Author

heads up: vcpkg has updated its sdl2 port to 2.0.14. microsoft/vcpkg@0a262e7

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

No branches or pull requests

1 participant