Skip to content

Commit

Permalink
Relax the build target checks in windows-targets sub-crates
Browse files Browse the repository at this point in the history
This allows e.g. x86_64-win7-windows-msvc and other alternative vendors to link.
  • Loading branch information
seritools committed Jan 4, 2024
1 parent d214aac commit 4d3a01a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 4 additions & 2 deletions crates/targets/aarch64_msvc/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
fn main() {
let target = std::env::var("TARGET").unwrap();
if target != "aarch64-pc-windows-msvc" && target != "aarch64-uwp-windows-msvc" {
let family = std::env::var("CARGO_CFG_TARGET_FAMILY").unwrap();
let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
let env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap();
if family != "windows" || arch != "aarch64" || env != "msvc" {
return;
}

Expand Down
6 changes: 4 additions & 2 deletions crates/targets/i686_msvc/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
fn main() {
let target = std::env::var("TARGET").unwrap();
if target != "i686-pc-windows-msvc" && target != "i686-uwp-windows-msvc" {
let family = std::env::var("CARGO_CFG_TARGET_FAMILY").unwrap();
let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
let env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap();
if family != "windows" || arch != "x86" || env != "msvc" {
return;
}

Expand Down
6 changes: 4 additions & 2 deletions crates/targets/x86_64_msvc/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
fn main() {
let target = std::env::var("TARGET").unwrap();
if target != "x86_64-pc-windows-msvc" && target != "x86_64-uwp-windows-msvc" {
let family = std::env::var("CARGO_CFG_TARGET_FAMILY").unwrap();
let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
let env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap();
if family != "windows" || arch != "x86_64" || env != "msvc" {
return;
}

Expand Down

0 comments on commit 4d3a01a

Please sign in to comment.