Skip to content

Commit

Permalink
MSVC: Always specify when building 32-bit MSVC (#144)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
skyfloogle authored Feb 23, 2022
1 parent 7793895 commit bfaf129
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,19 +606,10 @@ impl Config {
}
cmd.arg("-AARM64");
} else if target.contains("i686") {
use cc::windows_registry::{find_vs_version, VsVers};
match find_vs_version() {
Ok(VsVers::Vs16) => {
// 32-bit x86 toolset used to be the default for all hosts,
// but Visual Studio 2019 changed the default toolset to match the host,
// so we need to manually override it for x86 targets
if self.generator_toolset.is_none() {
cmd.arg("-Thost=x86");
}
cmd.arg("-AWin32");
}
_ => {}
};
if self.generator_toolset.is_none() {
cmd.arg("-Thost=x86");
}
cmd.arg("-AWin32");
} else {
panic!("unsupported msvc target: {}", target);
}
Expand Down

1 comment on commit bfaf129

@willox
Copy link

@willox willox commented on bfaf129 Mar 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this didn't get a release on crates.io?

Please sign in to comment.