Skip to content

Commit e01e6c6

Browse files
authored
Merge pull request #59 from barzamin/fix-macos-build
fix build on modern MacOS systems
2 parents 89f97b5 + 532ee7e commit e01e6c6

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

ui-sys/build.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,20 @@ fn main() {
4242
.write_to_file(out_path.join("bindings.rs"))
4343
.expect("Couldn't write bindings");
4444

45-
// Deterimine if we're building for MSVC
45+
// Deterimine build platform
4646
let target = env::var("TARGET").unwrap();
4747
let msvc = target.contains("msvc");
48+
let apple = target.contains("apple");
49+
4850
// Build libui if needed. Otherwise, assume it's in lib/
4951
let mut dst;
5052
if cfg!(feature = "build") {
51-
dst = Config::new("libui").build_target("").profile("release").build();
53+
let mut cfg = Config::new("libui");
54+
cfg.build_target("").profile("release");
55+
if apple {
56+
cfg.cxxflag("--stdlib=libc++");
57+
}
58+
dst = cfg.build();
5259

5360
let mut postfix = Path::new("build").join("out");
5461
if msvc {
@@ -62,7 +69,7 @@ fn main() {
6269
}
6370

6471
let libname;
65-
if msvc {
72+
if msvc {
6673
libname = "libui";
6774
} else {
6875
libname = "ui";

0 commit comments

Comments
 (0)