Bug 1302028 - part 4 - pass LIBCLANG_PATH and CLANG_PATH environment variables to cargo build; r?gps draft
authorNathan Froyd <froydnj@mozilla.com>
Thu, 15 Dec 2016 11:00:23 -0500
changeset 450030 774292be9e54bfbfcacaafcce1b23aba9c88b8d5
parent 450029 bd624b36e3acb9aae99e8d10f342219827fae297
child 450031 9d71233065aaca1b3f5c21919e65e025cfbd8a7f
push id38745
push userbmo:nfroyd@mozilla.com
push dateThu, 15 Dec 2016 21:18:23 +0000
reviewersgps
bugs1302028
milestone53.0a1
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
config/rules.mk
--- 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.