about summary refs log tree commit diff
path: root/src/bootstrap/build/compile.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bootstrap/build/compile.rs')
-rw-r--r--src/bootstrap/build/compile.rs21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/bootstrap/build/compile.rs b/src/bootstrap/build/compile.rs
index a027ac0fd60..db8c3e50907 100644
--- a/src/bootstrap/build/compile.rs
+++ b/src/bootstrap/build/compile.rs
@@ -16,7 +16,7 @@ use std::process::Command;
 use build_helper::output;
 
 use build::util::{exe, staticlib, libdir, mtime, is_dylib};
-use build::{Build, Compiler};
+use build::{Build, Compiler, Mode};
 
 /// Build the standard library.
 ///
@@ -39,9 +39,10 @@ pub fn std<'a>(build: &'a Build, stage: u32, target: &str,
 
     build_startup_objects(build, target, &libdir);
 
-    let out_dir = build.cargo_out(stage, &host, true, target);
+    let out_dir = build.cargo_out(stage, &host, Mode::Libstd, target);
     build.clear_if_dirty(&out_dir, &build.compiler_path(compiler));
-    let mut cargo = build.cargo(stage, compiler, true, target, "build");
+    let mut cargo = build.cargo(stage, compiler, Mode::Libstd, Some(target),
+                                "build");
     cargo.arg("--features").arg(build.std_features())
          .arg("--manifest-path")
          .arg(build.src.join("src/rustc/std_shim/Cargo.toml"));
@@ -71,7 +72,7 @@ pub fn std_link(build: &Build,
                 compiler: &Compiler,
                 host: &str) {
     let libdir = build.sysroot_libdir(stage, host, target);
-    let out_dir = build.cargo_out(stage, compiler.host, true, target);
+    let out_dir = build.cargo_out(stage, compiler.host, Mode::Libstd, target);
 
     // If we're linking one compiler host's output into another, then we weren't
     // called from the `std` method above. In that case we clean out what's
@@ -135,10 +136,11 @@ pub fn rustc<'a>(build: &'a Build, stage: u32, target: &str,
     println!("Building stage{} compiler artifacts ({} -> {})", stage,
              host, target);
 
-    let out_dir = build.cargo_out(stage, &host, false, target);
+    let out_dir = build.cargo_out(stage, &host, Mode::Librustc, target);
     build.clear_if_dirty(&out_dir, &libstd_shim(build, stage, &host, target));
 
-    let mut cargo = build.cargo(stage, compiler, false, target, "build");
+    let mut cargo = build.cargo(stage, compiler, Mode::Librustc, Some(target),
+                                "build");
     cargo.arg("--features").arg(build.rustc_features(stage))
          .arg("--manifest-path")
          .arg(build.src.join("src/rustc/Cargo.toml"));
@@ -200,14 +202,14 @@ pub fn rustc_link(build: &Build,
                   compiler: &Compiler,
                   host: &str) {
     let libdir = build.sysroot_libdir(stage, host, target);
-    let out_dir = build.cargo_out(stage, compiler.host, false, target);
+    let out_dir = build.cargo_out(stage, compiler.host, Mode::Librustc, target);
     add_to_sysroot(&out_dir, &libdir);
 }
 
 /// Cargo's output path for the standard library in a given stage, compiled
 /// by a particular compiler for the specified target.
 fn libstd_shim(build: &Build, stage: u32, host: &str, target: &str) -> PathBuf {
-    build.cargo_out(stage, host, true, target).join("libstd_shim.rlib")
+    build.cargo_out(stage, host, Mode::Libstd, target).join("libstd_shim.rlib")
 }
 
 fn compiler_file(compiler: &Path, file: &str) -> String {
@@ -239,7 +241,8 @@ pub fn assemble_rustc(build: &Build, stage: u32, host: &str) {
         }
     }
 
-    let out_dir = build.cargo_out(stage - 1, &build.config.build, false, host);
+    let out_dir = build.cargo_out(stage - 1, &build.config.build,
+                                  Mode::Librustc, host);
 
     // Link the compiler binary itself into place
     let rustc = out_dir.join(exe("rustc", host));