Inline crt-static choice for pc-windows-msvc

This avoids the possibility of a duplicate or conflicting crt-static
command line option sent to rustc.
This commit is contained in:
Samuel Holland 2017-08-22 16:24:29 -05:00
parent 4b09dc6e39
commit 52832439ad
2 changed files with 6 additions and 7 deletions

View File

@ -237,11 +237,6 @@ fn main() {
}
}
if target.contains("pc-windows-msvc") {
cmd.arg("-Z").arg("unstable-options");
cmd.arg("-C").arg("target-feature=+crt-static");
}
if let Ok(s) = env::var("RUSTC_CRT_STATIC") {
if s == "true" {
cmd.arg("-C").arg("target-feature=+crt-static");

View File

@ -658,8 +658,12 @@ impl Build {
/// Returns if this target should statically link the C runtime, if specified
fn crt_static(&self, target: Interned<String>) -> Option<bool> {
self.config.target_config.get(&target)
.and_then(|t| t.crt_static)
if target.contains("pc-windows-msvc") {
Some(true)
} else {
self.config.target_config.get(&target)
.and_then(|t| t.crt_static)
}
}
/// Returns the "musl root" for this `target`, if defined