Skip to content

Commit ffd571a

Browse files
committed
Include js-confdefs.h when building jsglue and running bindgen.
1 parent d2513df commit ffd571a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

build.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@ fn build_jsglue() {
122122
build.flag_if_supported(flag);
123123
}
124124

125+
let config = format!("{}/js/src/js-confdefs.h", out.display());
126+
if cfg!(windows) {
127+
build.flag("-FI");
128+
} else {
129+
build.flag("-include");
130+
}
131+
build.flag(&config);
132+
125133
build.file("src/jsglue.cpp");
126134
build.include(out.join("dist/include"));
127135
build.compile("jsglue");
@@ -169,6 +177,9 @@ fn build_jsapi_bindings() {
169177
builder = builder.clang_arg(flag);
170178
}
171179

180+
builder = builder.clang_arg("-include");
181+
builder = builder.clang_arg(out.join("js/src/js-confdefs.h").to_str().expect("UTF-8"));
182+
172183
println!("Generting bindings {:?}.", builder.command_line_flags());
173184

174185
for ty in UNSAFE_IMPL_SYNC_TYPES {

0 commit comments

Comments
 (0)