diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-03-02 14:42:45 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-03-02 14:42:45 +0100 |
commit | e08e0704a2538b4f8ab7bd92cf3b3c94c97c970c (patch) | |
tree | 0549e388430d01479873f054d1d05f6ae4905ed6 /components/style/build_gecko.rs | |
parent | b10574c06fe93c98609d8cbd46d8104aee34c582 (diff) | |
download | servo-e08e0704a2538b4f8ab7bd92cf3b3c94c97c970c.tar.gz servo-e08e0704a2538b4f8ab7bd92cf3b3c94c97c970c.zip |
Reland #20160 since it just needed a revendor that didn't happen automatically.
Diffstat (limited to 'components/style/build_gecko.rs')
-rw-r--r-- | components/style/build_gecko.rs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/components/style/build_gecko.rs b/components/style/build_gecko.rs index 7415bff8a26..bf6ded11c34 100644 --- a/components/style/build_gecko.rs +++ b/components/style/build_gecko.rs @@ -204,15 +204,25 @@ mod bindings { // Disable rust unions, because we replace some types inside of // them. - // - // FIXME(emilio, bug 1432153): Make the bindings rustfmt'd on - // automation. let mut builder = Builder::default() - .rustfmt_bindings(false) .rust_target(RustTarget::Stable_1_0); + let rustfmt_path = env::var_os("MOZ_AUTOMATION").and_then(|_| { + env::var_os("TOOLTOOL_DIR") + }).map(PathBuf::from); + + builder = match rustfmt_path { + Some(path) => { + builder.with_rustfmt(path.join("rustc").join("bin").join("rustfmt")) + }, + None => { + builder.rustfmt_bindings(env::var_os("STYLO_RUSTFMT_BINDINGS").is_some()) + } + }; + for dir in SEARCH_PATHS.iter() { builder = builder.clang_arg("-I").clang_arg(dir.to_str().unwrap()); } + builder = builder.include(add_include("mozilla-config.h")); if env::var("CARGO_FEATURE_GECKO_DEBUG").is_ok() { |