From d32f7e30696e432e2bf93d2b8a737edfc06f9128 Mon Sep 17 00:00:00 2001 From: Jordan Rhee Date: Tue, 18 Sep 2018 17:39:14 -0700 Subject: [PATCH] Msvc/Arm: Pass /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1 to cl.exe --- src/lib.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 7672cf4..fd2abcb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1159,6 +1159,19 @@ impl Build { cmd.args.push("/ARCH:IA32".into()); } } + + // There is a check in corecrt.h that will generate a + // compilation error if + // _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE is + // not defined to 1. The check was added in Windows + // 8 days because only store apps were allowed on ARM. + // This changed with the release of Windows 10 IoT Core. + // The check will be going away in future versions of + // the SDK, but for all released versions of the + // Windows SDK it is required. + if target.contains("arm") || target.contains("thumb") { + cmd.args.push("/D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1".into()); + } } ToolFamily::Gnu => { if target.contains("i686") || target.contains("i586") {