]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_llvm/build.rs
Fix windows-gnu host cross-compilation
[rust.git] / src / librustc_llvm / build.rs
index 21b8080714c1744ca54130adbb6325ece0082bff..25c0b40c495a0c807f84abc8259ed75be07cc03b 100644 (file)
@@ -151,6 +151,12 @@ fn main() {
             continue;
         }
 
+        // Include path contains host directory, replace it with target
+        if is_crossed && flag.starts_with("-I") {
+            cfg.flag(&flag.replace(&host, &target));
+            continue;
+        }
+
         cfg.flag(flag);
     }
 
@@ -189,6 +195,9 @@ fn main() {
 
     if !is_crossed {
         cmd.arg("--system-libs");
+    } else if target.contains("windows-gnu") {
+        println!("cargo:rustc-link-lib=shell32");
+        println!("cargo:rustc-link-lib=uuid");
     }
     cmd.args(&components);