+11
-3
@@ -116,6 +116,14 @@ // ************************************************************************** | ||
| fn compile_windows() { | ||
| cc::Build::new() | ||
| let linkage = env::var("CARGO_CFG_TARGET_FEATURE").unwrap_or(String::new()); | ||
| let mut cc = cc::Build::new(); | ||
| cc | ||
| .file("etc/hidapi/windows/hid.c") | ||
| .include("etc/hidapi/hidapi") | ||
| .compile("libhidapi.a"); | ||
| .include("etc/hidapi/hidapi"); | ||
| if linkage.contains("crt-static") { | ||
| // https://doc.rust-lang.org/reference/linkage.html#static-and-dynamic-c-runtimes | ||
| cc.static_crt(true); | ||
| } | ||
| cc.compile("libhidapi.a"); | ||
| println!("cargo:rustc-link-lib=setupapi"); | ||
@@ -122,0 +130,0 @@ } |
+5
-5
@@ -5,9 +5,9 @@ # This file is automatically @generated by Cargo. | ||
| name = "cc" | ||
| version = "1.0.65" | ||
| version = "1.0.66" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "95752358c8f7552394baf48cd82695b345628ad3f170d607de3ca03b8dacca15" | ||
| checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48" | ||
| [[package]] | ||
| name = "hidapi" | ||
| version = "1.2.5" | ||
| version = "1.2.6" | ||
| dependencies = [ | ||
@@ -21,5 +21,5 @@ "cc", | ||
| name = "libc" | ||
| version = "0.2.80" | ||
| version = "0.2.81" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614" | ||
| checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb" | ||
@@ -26,0 +26,0 @@ [[package]] |
+1
-1
@@ -15,3 +15,3 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO | ||
| name = "hidapi" | ||
| version = "1.2.5" | ||
| version = "1.2.6" | ||
| authors = ["Roland Ruckerbauer <roland.rucky@gmail.com>", "Osspial <osspial@gmail.com>", "Artyom Pavlov <newpavlov@gmail.com>", "mberndt123", "niklasad1"] | ||
@@ -18,0 +18,0 @@ build = "build.rs" |
+1
-1
@@ -19,3 +19,3 @@ # hidapi [](https://travis-ci.org/ruabmbua/hidapi-rs) [](https://crates.io/crates/hidapi) [](https://github.com/Osspial/hidapi-rs/blob/master/LICENSE.txt) [](https://docs.rs/hidapi) [](https://discordapp.com/invite/3ahhJGN) | ||
| // Print out information about all connected devices | ||
| for device in api.devices() { | ||
| for device in api.device_list() { | ||
| println!("{:#?}", device); | ||
@@ -22,0 +22,0 @@ } |
Sorry, the diff of this file is not supported yet