about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNick Platt <platt.nicholas@gmail.com>2016-04-10 00:27:32 -0400
committerNick Platt <platt.nicholas@gmail.com>2016-04-10 00:34:05 -0400
commit3632278c8407023c482cc23179fc31bf7a05c83f (patch)
tree914eb7f921f170cc55bb26a047cea9614e341b41
parent526f2bf5c534308193246e13ab2da8b3c0cf3cbb (diff)
downloadrust-3632278c8407023c482cc23179fc31bf7a05c83f.tar.gz
rust-3632278c8407023c482cc23179fc31bf7a05c83f.zip
Add rustbuild option to use Ninja for LLVM build
-rw-r--r--src/bootstrap/Cargo.lock4
-rw-r--r--src/bootstrap/Cargo.toml2
-rw-r--r--src/bootstrap/build/config.rs3
-rw-r--r--src/bootstrap/build/native.rs3
-rw-r--r--src/bootstrap/build/sanity.rs3
5 files changed, 12 insertions, 3 deletions
diff --git a/src/bootstrap/Cargo.lock b/src/bootstrap/Cargo.lock
index c33838a146c..9bb3e79744b 100644
--- a/src/bootstrap/Cargo.lock
+++ b/src/bootstrap/Cargo.lock
@@ -3,7 +3,7 @@ name = "bootstrap"
 version = "0.0.0"
 dependencies = [
  "build_helper 0.1.0",
- "cmake 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cmake 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
  "filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
  "gcc 0.3.26 (registry+https://github.com/rust-lang/crates.io-index)",
  "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -21,7 +21,7 @@ version = "0.1.0"
 
 [[package]]
 name = "cmake"
-version = "0.1.16"
+version = "0.1.17"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "gcc 0.3.26 (registry+https://github.com/rust-lang/crates.io-index)",
diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml
index 0d334219b4f..7b379e1c7b6 100644
--- a/src/bootstrap/Cargo.toml
+++ b/src/bootstrap/Cargo.toml
@@ -21,7 +21,7 @@ path = "rustdoc.rs"
 
 [dependencies]
 build_helper = { path = "../build_helper" }
-cmake = "0.1.10"
+cmake = "0.1.17"
 filetime = "0.1"
 num_cpus = "0.2"
 toml = "0.1"
diff --git a/src/bootstrap/build/config.rs b/src/bootstrap/build/config.rs
index 1e67c4a9a3e..9563a3629da 100644
--- a/src/bootstrap/build/config.rs
+++ b/src/bootstrap/build/config.rs
@@ -31,6 +31,7 @@ use toml::{Parser, Decoder, Value};
 #[derive(Default)]
 pub struct Config {
     pub ccache: bool,
+    pub ninja: bool,
     pub verbose: bool,
     pub submodules: bool,
     pub compiler_docs: bool,
@@ -107,6 +108,7 @@ struct Build {
 #[derive(RustcDecodable, Default)]
 struct Llvm {
     ccache: Option<bool>,
+    ninja: Option<bool>,
     assertions: Option<bool>,
     optimize: Option<bool>,
     version_check: Option<bool>,
@@ -200,6 +202,7 @@ impl Config {
 
         if let Some(ref llvm) = toml.llvm {
             set(&mut config.ccache, llvm.ccache);
+            set(&mut config.ninja, llvm.ninja);
             set(&mut config.llvm_assertions, llvm.assertions);
             set(&mut config.llvm_optimize, llvm.optimize);
             set(&mut config.llvm_optimize, llvm.optimize);
diff --git a/src/bootstrap/build/native.rs b/src/bootstrap/build/native.rs
index bf0494bcd8c..91bc0924b1f 100644
--- a/src/bootstrap/build/native.rs
+++ b/src/bootstrap/build/native.rs
@@ -43,6 +43,9 @@ pub fn llvm(build: &Build, target: &str) {
 
     // http://llvm.org/docs/CMake.html
     let mut cfg = cmake::Config::new(build.src.join("src/llvm"));
+    if build.config.ninja {
+        cfg.generator("Ninja");
+    }
     cfg.target(target)
        .host(&build.config.build)
        .out_dir(&dst)
diff --git a/src/bootstrap/build/sanity.rs b/src/bootstrap/build/sanity.rs
index 6ce27496388..50fd9c24538 100644
--- a/src/bootstrap/build/sanity.rs
+++ b/src/bootstrap/build/sanity.rs
@@ -48,6 +48,9 @@ pub fn check(build: &mut Build) {
             }
         }
         need_cmd("cmake".as_ref());
+        if build.config.ninja {
+            need_cmd("ninja".as_ref())
+        }
         break
     }