]> git.lizzy.rs Git - rust.git/blobdiff - src/bootstrap/lib.rs
Add a new wasm32-unknown-wasi target
[rust.git] / src / bootstrap / lib.rs
index 4887c9be6709a249d1e81538c3571ebf5edc6133..167455af1f2e64815ee0257223ef378e52449b4a 100644 (file)
@@ -727,6 +727,17 @@ fn verbose(&self, msg: &str) {
         }
     }
 
+    pub fn is_verbose_than(&self, level: usize) -> bool {
+        self.verbosity > level
+    }
+
+    /// Prints a message if this build is configured in more verbose mode than `level`.
+    fn verbose_than(&self, level: usize, msg: &str) {
+        if self.is_verbose_than(level) {
+            println!("{}", msg);
+        }
+    }
+
     fn info(&self, msg: &str) {
         if self.config.dry_run { return; }
         println!("{}", msg);
@@ -850,6 +861,13 @@ fn musl_root(&self, target: Interned<String>) -> Option<&Path> {
             .map(|p| &**p)
     }
 
+    /// Returns the sysroot for the wasi target, if defined
+    fn wasi_root(&self, target: Interned<String>) -> Option<&Path> {
+        self.config.target_config.get(&target)
+            .and_then(|t| t.wasi_root.as_ref())
+            .map(|p| &**p)
+    }
+
     /// Returns `true` if this is a no-std `target`, if defined
     fn no_std(&self, target: Interned<String>) -> Option<bool> {
         self.config.target_config.get(&target)
@@ -1159,6 +1177,7 @@ fn read_stamp_file(&self, stamp: &Path) -> Vec<(PathBuf, bool)> {
     /// Copies a file from `src` to `dst`
     pub fn copy(&self, src: &Path, dst: &Path) {
         if self.config.dry_run { return; }
+        self.verbose_than(1, &format!("Copy {:?} to {:?}", src, dst));
         let _ = fs::remove_file(&dst);
         let metadata = t!(src.symlink_metadata());
         if metadata.file_type().is_symlink() {