Skip to content

Commit

Permalink
Add feature for doc_cfg, specify allowed cfgs in build.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiwalun committed Jul 4, 2024
1 parent 2f37587 commit f63b1bf
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 f63b1bf

Please sign in to comment.