-
Notifications
You must be signed in to change notification settings - Fork 1
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
Support for v2 #10
Support for v2 #10
Conversation
instead of just linking to libdisplay-info use system-deps, which will use pkg-config internally, to resolve the native lib. this also limits the version to the currently supported one
901c059
to
eee9743
Compare
...contain libdisplay-info 0.2.0
let deps = system_deps::Config::new().probe().unwrap(); | ||
let native_lib = deps.get_by_name("libdisplay-info").unwrap(); | ||
let native_version = semver::Version::parse(&native_lib.version).unwrap(); | ||
let has_v2 = semver::VersionReq::parse(">=0.2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we error here on >= 0.3, assuming that would be another breaking change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, that is probably a good idea. added a commit to restrict the max version directly in the system_deps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
First commit changes the current version (bumping it to 0.1.1) to resolve the native lib using pkg-config and limiting it to 0.1 if the native lib.
Second commit adds support for 0.2, which can explicitly be enabled with a
v0_2
feature flag.In addition the build script enabled linking against 0.2 when the version is detected.
The safe wrapper should handle the
i32
<>i64
compatibility just fine and only expose 0.2 features whenthe corresponding feature flag is enabled.
Most things are just additions or compatible changes with the exception of the data type of
max_pixel_clock_hz
in thedi_edid_display_range_limits
.To solve this the
-sys
crate exports the type depending on the actual found native lib version like this:The safe wrapper will now always use
i64
and just usei64::from
to convert from thedi_edid_display_range_limits_max_pixel_clock_hz
value.TODO
fixes #9