Skip to content

Commit f4729f2

Browse files
committed
build-manifest: generate MSI and MINGW arrays from rustc
1 parent a80d39a commit f4729f2

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

src/tools/build-manifest/build.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ fn main() {
6060
let mut output = String::new();
6161

6262
writeln!(output, "static HOSTS: &[&str] = &[").unwrap();
63-
for host in targets.hosts {
63+
for host in &targets.hosts {
6464
writeln!(output, " {:?},", host).unwrap();
6565
}
6666
writeln!(output, "];").unwrap();
@@ -71,6 +71,22 @@ fn main() {
7171
}
7272
writeln!(output, "];").unwrap();
7373

74+
writeln!(output, "static MSI_INSTALLERS: &[&str] = &[").unwrap();
75+
for host in &targets.hosts {
76+
if host.contains("-windows-") {
77+
writeln!(output, " {:?},", host).unwrap();
78+
}
79+
}
80+
writeln!(output, "];").unwrap();
81+
82+
writeln!(output, "static MINGW: &[&str] = &[").unwrap();
83+
for host in targets.hosts {
84+
if host.contains("-windows-gnu") {
85+
writeln!(output, " {:?},", host).unwrap();
86+
}
87+
}
88+
writeln!(output, "];").unwrap();
89+
7490
std::fs::write(PathBuf::from(std::env::var_os("OUT_DIR").unwrap()).join("targets.rs"), output)
7591
.unwrap();
7692
}

src/tools/build-manifest/src/main.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,8 @@ static DOCS_FALLBACK: &[(&str, &str)] = &[
2929
("", "x86_64-unknown-linux-gnu"),
3030
];
3131

32-
static MSI_INSTALLERS: &[&str] = &[
33-
"aarch64-pc-windows-msvc",
34-
"i686-pc-windows-gnu",
35-
"i686-pc-windows-msvc",
36-
"x86_64-pc-windows-gnu",
37-
"x86_64-pc-windows-msvc",
38-
];
39-
4032
static PKG_INSTALLERS: &[&str] = &["x86_64-apple-darwin", "aarch64-apple-darwin"];
4133

42-
static MINGW: &[&str] = &["i686-pc-windows-gnu", "x86_64-pc-windows-gnu"];
43-
4434
static NIGHTLY_ONLY_COMPONENTS: &[PkgType] =
4535
&[PkgType::Miri, PkgType::JsonDocs, PkgType::RustcCodegenCranelift];
4636

0 commit comments

Comments
 (0)