Skip to content

Commit

Permalink
docs: include feature flags in doc builds
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeissl committed Jan 6, 2025
1 parent fb9f40f commit 6d1489c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
6 changes: 4 additions & 2 deletions libdisplay-info-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ categories = ["api-bindings"]
description = "Low-level bindings for libdisplay-info."
documentation = "https://docs.rs/libdisplay-info-sys/"
edition = "2021"
version = "0.2.1"
version = "0.2.2"
keywords = ["libdisplay", "DisplayID", "EDID"]
license = "MIT"
name = "libdisplay-info-sys"
repository = "https://github.com/Smithay/libdisplay-info-rs"
readme = "README.md"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[package.metadata.docs.rs]
features = ["v0_2"]
rustdoc-args = ["--cfg", "docsrs"]

[features]
v0_2 = []
Expand Down
4 changes: 1 addition & 3 deletions libdisplay-info-sys/build.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
fn main() {
if std::env::var("DOCS_RS").is_ok() {
// don't link against unavailable native lib in doc.rs builds and
// just assume the highest version is available
println!("cargo:rustc-cfg=feature=\"v0_2\"");
// don't link against unavailable native lib in doc.rs builds
return;
}

Expand Down
1 change: 1 addition & 0 deletions libdisplay-info-sys/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
Expand Down
8 changes: 5 additions & 3 deletions libdisplay-info/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@ categories = ["api-bindings"]
description = "EDID and DisplayID library."
documentation = "https://docs.rs/libdisplay-info/"
edition = "2021"
version = "0.2.1"
version = "0.2.2"
keywords = ["libdisplay", "DisplayID", "EDID"]
license = "MIT"
name = "libdisplay-info"
repository = "https://github.com/Smithay/libdisplay-info-rs"
readme = "../README.md"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[package.metadata.docs.rs]
features = ["v0_2"]
rustdoc-args = ["--cfg", "docsrs"]

[features]
v0_2 = ["libdisplay-info-sys/v0_2"]

[dependencies]
libdisplay-info-sys = { version = "0.2.1", path = "../libdisplay-info-sys" }
libdisplay-info-sys = { version = "0.2.2", path = "../libdisplay-info-sys" }
libc = "0.2.155"
thiserror = "2.0.9"
libdisplay-info-derive = { version = "0.1.0", path = "../libdisplay-info-derive" }
Expand Down
2 changes: 2 additions & 0 deletions libdisplay-info/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

use std::{
ffi::{c_char, CStr},
marker::PhantomData,
Expand Down

0 comments on commit 6d1489c

Please sign in to comment.