Skip to content

Commit efda8ad

Browse files
committed
Always compile rustc/bootstrap with Win7+ support
1 parent 0617430 commit efda8ad

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/bootstrap/compile.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,29 @@ pub fn rustc_cargo_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetS
603603
cargo.env("LLVM_NDEBUG", "1");
604604
}
605605
}
606+
607+
if target.contains("windows") {
608+
// all `target_api_feature`s for the currently officially supported
609+
// windows version for rust
610+
const WINDOWS_VERSIONS: [&str; 12] = [
611+
"3.10.511", // NT 3.1
612+
"3.10.528", // NT 3.1 SP3
613+
"3.50.807", // NT 3.5
614+
"3.51.1057", // NT 3.51
615+
"4.0.1381", // NT 4
616+
"5.0.2195", // 2000
617+
"5.1.2600", // XP
618+
"5.2.3790", // XP 64bit, Server 2003
619+
"6.0.6000", // Vista, Server 2008
620+
"6.0.6001", // Vista SP1, Server 2008 SP1
621+
"6.0.6002", // Vista SP2, Server 2008 SP2
622+
"6.1.7600", // 7, Server 2008 R2
623+
];
624+
625+
for v in &WINDOWS_VERSIONS {
626+
cargo.rustflag(&format!("--cfg=target_api_feature=\"{}\"", v));
627+
}
628+
}
606629
}
607630

608631
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]

0 commit comments

Comments
 (0)