diff options
author | Brad King <brad.king@kitware.com> | 2019-03-15 14:18:45 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-03-15 14:19:01 (GMT) |
commit | 7d77607d109c1061cc90bdde8fcbe5ebdcfdb016 (patch) | |
tree | a3b38718b76f97d5111b64700e21d60de814dadf /Source/cmGlobalVisualStudioVersionedGenerator.cxx | |
parent | 41d796c09be11da2284182e7da7f79940e86e07b (diff) | |
parent | 5c50eeaffc334891af73f3a72557693c86ee380e (diff) | |
download | CMake-7d77607d109c1061cc90bdde8fcbe5ebdcfdb016.zip CMake-7d77607d109c1061cc90bdde8fcbe5ebdcfdb016.tar.gz CMake-7d77607d109c1061cc90bdde8fcbe5ebdcfdb016.tar.bz2 |
Merge topic 'vs2019-wow64'
5c50eeaffc VS: Fix x64 host recognition by x86 cmake process
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3102
Diffstat (limited to 'Source/cmGlobalVisualStudioVersionedGenerator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudioVersionedGenerator.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx index 391fe69..2ba1aff 100644 --- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx +++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx @@ -18,8 +18,15 @@ #elif defined(_M_IA64) # define HOST_PLATFORM_NAME "Itanium" # define HOST_TOOLS_ARCH "" +#elif defined(_WIN64) +# define HOST_PLATFORM_NAME "x64" +# define HOST_TOOLS_ARCH "x64" #else -# include "cmsys/SystemInformation.hxx" +static bool VSIsWow64() +{ + BOOL isWow64 = false; + return IsWow64Process(GetCurrentProcess(), &isWow64) && isWow64; +} #endif static std::string VSHostPlatformName() @@ -27,8 +34,7 @@ static std::string VSHostPlatformName() #ifdef HOST_PLATFORM_NAME return HOST_PLATFORM_NAME; #else - cmsys::SystemInformation info; - if (info.Is64Bits()) { + if (VSIsWow64()) { return "x64"; } else { return "Win32"; @@ -41,8 +47,7 @@ static std::string VSHostArchitecture() #ifdef HOST_TOOLS_ARCH return HOST_TOOLS_ARCH; #else - cmsys::SystemInformation info; - if (info.Is64Bits()) { + if (VSIsWow64()) { return "x64"; } else { return "x86"; |