Skip to content

Commit

Permalink
Fix windows-gnu host cross-compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
mati865 committed Aug 19, 2020
1 parent 0a49057 commit fbce878
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ fn make_win_dist(
let idx = line.find(':').unwrap();
let key = &line[..idx];
let trim_chars: &[_] = &[' ', '='];
let value = line[(idx + 1)..].trim_start_matches(trim_chars).split(';').map(PathBuf::from);
let value = env::split_paths(line[(idx + 1)..].trim_start_matches(trim_chars));

if key == "programs" {
bin_path.extend(value);
Expand Down
9 changes: 9 additions & 0 deletions src/librustc_llvm/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit fbce878

Please sign in to comment.