]> git.lizzy.rs Git - rust.git/commitdiff
Skip creating sysroot target dir if it will be empty
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>
Sat, 14 Jan 2023 18:45:47 +0000 (18:45 +0000)
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>
Sat, 14 Jan 2023 18:45:47 +0000 (18:45 +0000)
build_system/build_sysroot.rs

index f92841ab993d1a9c71422a68d1c59a6594a04d26..d3bc7ec01286a474e9bcbc0442766f3ab4039227 100644 (file)
@@ -103,6 +103,10 @@ struct SysrootTarget {
 
 impl SysrootTarget {
     fn install_into_sysroot(&self, sysroot: &Path) {
+        if self.libs.is_empty() {
+            return;
+        }
+
         let target_rustlib_lib = sysroot.join("lib").join("rustlib").join(&self.triple).join("lib");
         fs::create_dir_all(&target_rustlib_lib).unwrap();