From 760a63293673271b74fdeac3d574f6113975078f Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 22 May 2018 13:33:27 +0200 Subject: [PATCH] Tools: Fix architecture detection for wininterrupt Previously, the detection relied on the variable CPU which is no longer set current versions of MSVC. Use newly introduced variable VSCMD_ARG_TGT_ARCH (MSVC 2017) or Platform (MSVC 2015) to detect 64bit. Change-Id: I705dbd7d3d7912c36e588a5ff399e65b4ca6f500 Reviewed-by: Christian Stenger Reviewed-by: Eike Ziller --- src/tools/wininterrupt/wininterrupt.pro | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/tools/wininterrupt/wininterrupt.pro b/src/tools/wininterrupt/wininterrupt.pro index d7ea748d2ac..5e4621cd5b3 100644 --- a/src/tools/wininterrupt/wininterrupt.pro +++ b/src/tools/wininterrupt/wininterrupt.pro @@ -25,11 +25,14 @@ build_all:!build_pass { CONFIG += release } -ENV_CPU=$$(CPU) +# Check for VSCMD_ARG_TGT_ARCH (VS 17) or Platform=X64 (VS 13, 15) +# For older versions, fall back to hacky check on LIBPATH +ENV_TARGET_ARCH=$$(VSCMD_ARG_TGT_ARCH) +isEmpty(ENV_TARGET_ARCH):ENV_TARGET_ARCH = $$(Platform) ENV_LIBPATH=$$(LIBPATH) -contains(ENV_CPU, ^AMD64$) { +contains(ENV_TARGET_ARCH, .*64$) { TARGET = win64interrupt -} else:isEmpty(ENV_CPU):contains(ENV_LIBPATH, ^.*amd64.*$) { +} else:isEmpty(ENV_TARGET_ARCH):contains(ENV_LIBPATH, ^.*amd64.*$) { TARGET = win64interrupt } else { TARGET = win32interrupt