Skip to content

Commit

Permalink
Properly inform cargo that we are using some env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
nox committed Oct 9, 2019
1 parent 6ba171e commit 169bcc0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ fn ignore(path: &Path) -> bool {
}

fn find_make() -> OsString {
println!("cargo:rerun-if-env-changed=MAKE");
if let Some(make) = env::var_os("MAKE") {
make
} else {
Expand Down Expand Up @@ -98,6 +99,7 @@ fn build_jsapi() {
let target = env::var("TARGET").unwrap();
let mut make = find_make();
// Put MOZTOOLS_PATH at the beginning of PATH if specified
println!("cargo:rerun-if-env-changed=MOZTOOLS_PATH");
if let Some(moztools) = env::var_os("MOZTOOLS_PATH") {
let path = env::var_os("PATH").unwrap();
let mut paths = Vec::new();
Expand Down Expand Up @@ -222,12 +224,14 @@ fn build_jsapi_bindings() {
builder = builder.clang_arg("-fms-compatibility");
}

println!("cargo:rerun-if-env-changed=CXXFLAGS");
if let Ok(flags) = env::var("CXXFLAGS") {
for flag in flags.split_whitespace() {
builder = builder.clang_arg(flag);
}
}

println!("cargo:rerun-if-env-changed=CLANGFLAGS");
if let Ok(flags) = env::var("CLANGFLAGS") {
for flag in flags.split_whitespace() {
builder = builder.clang_arg(flag);
Expand Down

0 comments on commit 169bcc0

Please sign in to comment.