Skip to content

Commit 3ec118d

Browse files
committed
Don't pass RUSTFLAGS to the invocation of binding-generator
It's meant to be only applied to the final artifacts, so it's problematic during cross-compile: rust-lang/cargo#4423
1 parent 067b5ac commit 3ec118d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGES.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
* 0.81.2
2+
* Fix building when crosscompiling with target-specific RUSTFLAGS
3+
14
* 0.81.1
25
* Fix building on macOS (fixes https://github.com/twistedfall/opencv-rust/issues/460)
36

build.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ fn build_clang_generator() -> io::Result<Child> {
290290
"--bin",
291291
"binding-generator",
292292
])
293-
.env("CARGO_TARGET_DIR", &*OUT_DIR);
293+
.env("CARGO_TARGET_DIR", &*OUT_DIR)
294+
.env_remove("CARGO_ENCODED_RUSTFLAGS"); // RUSTFLAGS are meant to affect final build artifacts only
294295
if let Some(host_triple) = HOST_TRIPLE.as_ref() {
295296
cargo.args(["--target", host_triple]);
296297
}

0 commit comments

Comments
 (0)