Skip to content
This repository was archived by the owner on Feb 26, 2020. It is now read-only.

Commit a85c708

Browse files
authored
Added OS X support
1 parent 05eda93 commit a85c708

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

build.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,13 @@ fn compile() {
4343
.compile("libhidapi.a");
4444
println!("cargo:rustc-link-lib=setupapi");
4545
}
46+
47+
#[cfg(target_os = "macos")]
48+
fn compile() {
49+
gcc::Config::new()
50+
.file("etc/hidapi/mac/hid.c")
51+
.include("etc/hidapi/hidapi")
52+
.compile("libhidapi.a");
53+
println!("cargo:rustc-link-lib=framework=IOKit");
54+
println!("cargo:rustc-link-lib=framework=CoreFoundation");
55+
}

0 commit comments

Comments
 (0)