summaryrefslogtreecommitdiff
path: root/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/build.rs b/build.rs
index 38950d3..c52bf34 100644
--- a/build.rs
+++ b/build.rs
@@ -101,5 +101,10 @@ fn main() {
.file(version_source)
.compile("libnitrokey.a");
- println!("cargo:rustc-link-lib=hidapi-libusb");
+ let hidapi_library_name = if cfg!(target_os = "linux") {
+ "hidapi-libusb"
+ } else {
+ "hidapi"
+ };
+ println!("cargo:rustc-link-lib={}", hidapi_library_name);
}