Skip to content

Commit bfaf129

Browse files
authored
MSVC: Always specify when building 32-bit MSVC (#144)
VS2022 is out, and is not listed as one of the "must specify 32-bit" versions, therefore building 32-bit libraries with this broke. The easiest solution is to just always specify 32-bit when building for it.
1 parent 7793895 commit bfaf129

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

src/lib.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -606,19 +606,10 @@ impl Config {
606606
}
607607
cmd.arg("-AARM64");
608608
} else if target.contains("i686") {
609-
use cc::windows_registry::{find_vs_version, VsVers};
610-
match find_vs_version() {
611-
Ok(VsVers::Vs16) => {
612-
// 32-bit x86 toolset used to be the default for all hosts,
613-
// but Visual Studio 2019 changed the default toolset to match the host,
614-
// so we need to manually override it for x86 targets
615-
if self.generator_toolset.is_none() {
616-
cmd.arg("-Thost=x86");
617-
}
618-
cmd.arg("-AWin32");
619-
}
620-
_ => {}
621-
};
609+
if self.generator_toolset.is_none() {
610+
cmd.arg("-Thost=x86");
611+
}
612+
cmd.arg("-AWin32");
622613
} else {
623614
panic!("unsupported msvc target: {}", target);
624615
}

0 commit comments

Comments
 (0)