Skip to content

Commit fbce878

Browse files
committed
Fix windows-gnu host cross-compilation
1 parent 0a49057 commit fbce878

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/bootstrap/dist.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ fn make_win_dist(
226226
let idx = line.find(':').unwrap();
227227
let key = &line[..idx];
228228
let trim_chars: &[_] = &[' ', '='];
229-
let value = line[(idx + 1)..].trim_start_matches(trim_chars).split(';').map(PathBuf::from);
229+
let value = env::split_paths(line[(idx + 1)..].trim_start_matches(trim_chars));
230230

231231
if key == "programs" {
232232
bin_path.extend(value);

src/librustc_llvm/build.rs

+9
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ fn main() {
151151
continue;
152152
}
153153

154+
// Include path contains host directory, replace it with target
155+
if is_crossed && flag.starts_with("-I") {
156+
cfg.flag(&flag.replace(&host, &target));
157+
continue;
158+
}
159+
154160
cfg.flag(flag);
155161
}
156162

@@ -189,6 +195,9 @@ fn main() {
189195

190196
if !is_crossed {
191197
cmd.arg("--system-libs");
198+
} else if target.contains("windows-gnu") {
199+
println!("cargo:rustc-link-lib=shell32");
200+
println!("cargo:rustc-link-lib=uuid");
192201
}
193202
cmd.args(&components);
194203

0 commit comments

Comments
 (0)