Skip to content

Commit

Permalink
Update rustbuild commentary
Browse files Browse the repository at this point in the history
Also use `cfg!(feature = "rustbuild")` instead of the environment
variable to ease grep-ability.
  • Loading branch information
tamird committed Sep 13, 2017
1 parent 23f14d3 commit a32e76e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4106,9 +4106,11 @@ mod c {
// also needs to satisfy intrinsics that jemalloc or C in general may
// need, so include a few more that aren't typically needed by
// LLVM/Rust.
sources.extend(&[
"ffsdi2.c",
]);
if cfg!(feature = "rustbuild") {
sources.extend(&[
"ffsdi2.c",
]);
}

if target_os != "ios" {
sources.extend(
Expand Down Expand Up @@ -4359,7 +4361,9 @@ mod c {
sources.remove(&["aeabi_cdcmp", "aeabi_cfcmp"]);
}

let root = if env::var_os("CARGO_FEATURE_RUSTBUILD").is_some() {
// When compiling in rustbuild (the rust-lang/rust repo) this build
// script runs from a directory other than this root directory.
let root = if cfg!(feature = "rustbuild") {
Path::new("../../libcompiler_builtins")
} else {
Path::new(".")
Expand Down

0 comments on commit a32e76e

Please sign in to comment.