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

Commit 212cb15

Browse files
authored
Merge pull request #1 from dyerti/osx-support
Added OS X support
2 parents 05eda93 + 087435c commit 212cb15

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

.travis.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
os:
2+
- linux
3+
- osx
4+
15
language: rust
26

3-
before_install:
4-
- sudo apt-get update
5-
- sudo apt-get install libusb-1.0-0-dev
7+
addons:
8+
apt:
9+
packages:
10+
- libusb-1.0-0-dev

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)