Skip to content

Commit

Permalink
Merge pull request #158 from Tiwalun/fix-docsrs-cfg
Browse files Browse the repository at this point in the history
Add feature for doc_cfg, specify allowed cfgs in build.rs
  • Loading branch information
ruabmbua committed Aug 3, 2024
2 parents 2f37587 + f63b1bf commit dd640ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ use std::env;
fn main() {
let target = env::var("TARGET").unwrap();

println!("cargo::rustc-check-cfg=cfg(hidapi)");
println!("cargo::rustc-check-cfg=cfg(libusb)");

if target.contains("linux") {
compile_linux();
} else if target.contains("windows") {
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
//! Since `hidapi` 0.12 it is possible to open MacOS devices with shared access, so that multiple
//! [`HidDevice`] handles can access the same physical device. For backward compatibility this is
//! an opt-in that can be enabled with the `macos-shared-device` feature flag.
#![cfg_attr(docsrs, feature(doc_cfg))]

mod error;
mod ffi;
Expand Down

0 comments on commit dd640ce

Please sign in to comment.