Skip to content

Commit

Permalink
wip: support for v0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeissl committed Jan 3, 2025
1 parent 1c1f614 commit 80d7c8f
Show file tree
Hide file tree
Showing 12 changed files with 1,462 additions and 135 deletions.
11 changes: 9 additions & 2 deletions libdisplay-info-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ categories = ["api-bindings"]
description = "Low-level bindings for libdisplay-info."
documentation = "https://docs.rs/libdisplay-info-sys/"
edition = "2021"
version = "0.1.1"
version = "0.2.0"
keywords = ["libdisplay", "DisplayID", "EDID"]
license = "MIT"
name = "libdisplay-info-sys"
Expand All @@ -13,9 +13,16 @@ readme = "README.md"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
v0_2 = []

[build-dependencies]
system-deps = "7.0.3"
semver = "1.0.24"

[dependencies]

[package.metadata.system-deps.libdisplay-info]
name = "libdisplay-info"
version = ">= 0.1.0, < 0.2.0"
version = "0.1.0"
v0_2 = { version = "0.2.0" }
10 changes: 9 additions & 1 deletion libdisplay-info-sys/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
fn main() {
system_deps::Config::new().probe().unwrap();
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")
.unwrap()
.matches(&native_version);
if has_v2 {
println!("cargo:rustc-cfg=feature=\"v0_2\"");
}
}
Loading

0 comments on commit 80d7c8f

Please sign in to comment.