diff options
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | build.rs | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 492afa0..26f88a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased - Use the -std=c++14 compiler flag. +- Change the build script to link to `-lhidapi` on non-Linux operating systems + (while still using `-lhidapi-libusb` on Linux). # v3.4.1 (2018-12-10) @@ -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); } |