Skip to content
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

docs: include feature flags in doc builds #12

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading