summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudioVersionedGenerator.cxx
diff options
context:
space:
mode:
authorNiyas Sait <niyas.sait@linaro.org>2022-05-15 17:15:21 (GMT)
committerBrad King <brad.king@kitware.com>2022-05-19 13:57:54 (GMT)
commitaf6928ce92783c1583f8f9ae25e50c2991ebd0c0 (patch)
tree06ed0a61973f13de1a07a4b2a6b785e1a78c2919 /Source/cmGlobalVisualStudioVersionedGenerator.cxx
parentdc3d0b5a0a7d26d43d6cfeb511e224533b5d188f (diff)
downloadCMake-af6928ce92783c1583f8f9ae25e50c2991ebd0c0.zip
CMake-af6928ce92783c1583f8f9ae25e50c2991ebd0c0.tar.gz
CMake-af6928ce92783c1583f8f9ae25e50c2991ebd0c0.tar.bz2
VS: ARM64 as default toolset architecture for ARM64 host
Visual Studio 2022 17 Preview introduced a native ARM64 toolchain.
Diffstat (limited to 'Source/cmGlobalVisualStudioVersionedGenerator.cxx')
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.cxx18
1 files changed, 11 insertions, 7 deletions
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
index bc38335..1c05d36 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
@@ -27,16 +27,17 @@
#if defined(_M_ARM64)
# define HOST_PLATFORM_NAME "ARM64"
-# define HOST_TOOLS_ARCH ""
+# define HOST_TOOLS_ARCH(v) \
+ (v >= cmGlobalVisualStudioGenerator::VSVersion::VS17) ? "ARM64" : ""
#elif defined(_M_ARM)
# define HOST_PLATFORM_NAME "ARM"
-# define HOST_TOOLS_ARCH ""
+# define HOST_TOOLS_ARCH(v) ""
#elif defined(_M_IA64)
# define HOST_PLATFORM_NAME "Itanium"
-# define HOST_TOOLS_ARCH ""
+# define HOST_TOOLS_ARCH(v) ""
#elif defined(_WIN64)
# define HOST_PLATFORM_NAME "x64"
-# define HOST_TOOLS_ARCH "x64"
+# define HOST_TOOLS_ARCH(v) "x64"
#else
static bool VSIsWow64()
{
@@ -58,10 +59,12 @@ static std::string VSHostPlatformName()
#endif
}
-static std::string VSHostArchitecture()
+static std::string VSHostArchitecture(
+ cmGlobalVisualStudioGenerator::VSVersion v)
{
+ static_cast<void>(v);
#ifdef HOST_TOOLS_ARCH
- return HOST_TOOLS_ARCH;
+ return HOST_TOOLS_ARCH(v);
#else
if (VSIsWow64()) {
return "x64";
@@ -433,7 +436,8 @@ cmGlobalVisualStudioVersionedGenerator::cmGlobalVisualStudioVersionedGenerator(
this->DefaultLinkFlagTableName = VSVersionToToolset(this->Version);
if (this->Version >= cmGlobalVisualStudioGenerator::VSVersion::VS16) {
this->DefaultPlatformName = VSHostPlatformName();
- this->DefaultPlatformToolsetHostArchitecture = VSHostArchitecture();
+ this->DefaultPlatformToolsetHostArchitecture =
+ VSHostArchitecture(this->Version);
}
if (this->Version >= cmGlobalVisualStudioGenerator::VSVersion::VS17) {
// FIXME: Search for an existing framework? Under '%ProgramFiles(x86)%',