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 453507 ea0aecb876f9ecf9bf7a9f4d1c3fbe8d62e5e849
parent 453506 75c645a2f080d084686fd0e291a323da3726cdc1
child 453508 47c6fb572b27dfb891bdce8ae0453980db2c0e9f
push id39696
push userbmo:nfroyd@mozilla.com
push dateFri, 23 Dec 2016 18:35:18 +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.