Bug 1302028 - part 4 - pass LIBCLANG_PATH and CLANG_PATH environment variables to cargo build; r?gps
We need both of these: LIBCLANG_PATH is necessary when building the
clang-sys crate or its dependencies, and CLANG_PATH is necessary when
actually using the clang-sys crate.
MozReview-Commit-ID: 8OEaf9Fetn5
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -937,17 +937,23 @@ endif
# choices, and Cargo only supports two, we choose to enable various
# optimization levels in our Cargo.toml files all the time, and override the
# optimization level here, if necessary. (The Cargo.toml files already
# specify debug-assertions appropriately for --{disable,enable}-debug.)
ifndef MOZ_OPTIMIZE
rustflags_override = RUSTFLAGS='-C opt-level=0'
endif
-CARGO_BUILD = env $(rustflags_override) CARGO_TARGET_DIR=. RUSTC=$(RUSTC) MOZ_DIST=$(ABS_DIST) $(CARGO) build $(cargo_build_flags)
+CARGO_BUILD = env $(rustflags_override) \
+ CARGO_TARGET_DIR=. \
+ RUSTC=$(RUSTC) \
+ MOZ_DIST=$(ABS_DIST) \
+ LIBCLANG_PATH=$(MOZ_LIBCLANG_PATH) \
+ CLANG_PATH=$(MOZ_CLANG_PATH) \
+ $(CARGO) build $(cargo_build_flags)
ifdef RUST_LIBRARY_FILE
ifdef RUST_LIBRARY_FEATURES
rust_features_flag := --features "$(RUST_LIBRARY_FEATURES)"
endif
# Assume any system libraries rustc links against are already in the target's LIBS.