Skip to content

Commit ee7b97e

Browse files
authored
Merge pull request #349 from jordanrh1/windows-arm-api-partition
Msvc/Arm: Pass /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1 to cl.exe
2 parents fe0a7ac + d32f7e3 commit ee7b97e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/lib.rs

+13
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,19 @@ impl Build {
11591159
cmd.args.push("/ARCH:IA32".into());
11601160
}
11611161
}
1162+
1163+
// There is a check in corecrt.h that will generate a
1164+
// compilation error if
1165+
// _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE is
1166+
// not defined to 1. The check was added in Windows
1167+
// 8 days because only store apps were allowed on ARM.
1168+
// This changed with the release of Windows 10 IoT Core.
1169+
// The check will be going away in future versions of
1170+
// the SDK, but for all released versions of the
1171+
// Windows SDK it is required.
1172+
if target.contains("arm") || target.contains("thumb") {
1173+
cmd.args.push("/D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1".into());
1174+
}
11621175
}
11631176
ToolFamily::Gnu => {
11641177
if target.contains("i686") || target.contains("i586") {

0 commit comments

Comments
 (0)