Skip to content

Commit b102477

Browse files
Madison McGaffinRalith
Madison McGaffin
authored andcommitted
Fix build on macOS
1 parent 5d755c0 commit b102477

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

build.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ fn main() {
77
#[cfg(windows)]
88
cfg.cxxflag("/DWIN32");
99

10+
#[cfg(target_os="macos")]
11+
cfg.define("BUILD_UNIVERSAL", "OFF");
12+
1013
let dst = cfg.build();
1114
println!("cargo:rustc-link-search=native={}/lib", dst.display());
1215

@@ -18,4 +21,7 @@ fn main() {
1821

1922
#[cfg(target_os="linux")]
2023
println!("cargo:rustc-link-lib=stdc++");
24+
25+
#[cfg(target_os="macos")]
26+
println!("cargo:rustc-link-lib=c++");
2127
}

lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@
33
non_snake_case)]
44

55
include!("bindings.rs");
6+
7+
#[cfg(target_os="macos")]
8+
#[link(name = "Foundation", kind = "framework")]
9+
extern { }

0 commit comments

Comments
 (0)