Skip to content

Commit b76b428

Browse files
committed
Pass the appropriate -stdlib C++ compiler flag to the configure script.
We were already choosing the appropriate flag when compiling `jsglue.cpp`, but we didn't pass the flag along to `configure`, so on macOS Mojave the configure script would detect a seemingly-broken C++ compiler and abort.
1 parent 180b01c commit b76b428

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ fn build_jsapi() {
101101
cmd.env("MAKEFLAGS", makeflags);
102102
}
103103

104+
if target.contains("apple") || target.contains("freebsd") {
105+
cmd.env("CXXFLAGS", "-stdlib=libc++");
106+
}
107+
104108
let result = cmd.args(&["-R", "-f", "makefile.cargo"])
105109
.stdout(Stdio::inherit())
106110
.stderr(Stdio::inherit())

0 commit comments

Comments
 (0)