summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-01-18 16:41:31 (GMT)
committerBrad King <brad.king@kitware.com>2019-01-18 17:29:53 (GMT)
commitb70c0aed5c616edce5cbc803c7de92580f835f90 (patch)
tree369341ad0f0e8a260a23a598ce07c14103704554
parenta61c061b6143cb6d8920b1b5796a867c0f104556 (diff)
downloadCMake-b70c0aed5c616edce5cbc803c7de92580f835f90.zip
CMake-b70c0aed5c616edce5cbc803c7de92580f835f90.tar.gz
CMake-b70c0aed5c616edce5cbc803c7de92580f835f90.tar.bz2
VS: Factor out helper function to compute host platform name
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.cxx25
1 files changed, 15 insertions, 10 deletions
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
index 99f9503..15e52fe 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
@@ -19,6 +19,20 @@
# include "cmsys/SystemInformation.hxx"
#endif
+static std::string VSHostPlatformName()
+{
+#ifdef HOST_PLATFORM_NAME
+ return HOST_PLATFORM_NAME;
+#else
+ cmsys::SystemInformation info;
+ if (info.Is64Bits()) {
+ return "x64";
+ } else {
+ return "Win32";
+ }
+#endif
+}
+
static unsigned int VSVersionToMajor(
cmGlobalVisualStudioGenerator::VSVersion v)
{
@@ -206,16 +220,7 @@ cmGlobalVisualStudioVersionedGenerator::cmGlobalVisualStudioVersionedGenerator(
this->DefaultCSharpFlagTableName = VSVersionToToolset(this->Version);
this->DefaultLinkFlagTableName = VSVersionToToolset(this->Version);
if (this->Version >= cmGlobalVisualStudioGenerator::VS16) {
-#ifdef HOST_PLATFORM_NAME
- this->DefaultPlatformName = HOST_PLATFORM_NAME;
-#else
- cmsys::SystemInformation info;
- if (info.Is64Bits()) {
- this->DefaultPlatformName = "x64";
- } else {
- this->DefaultPlatformName = "Win32";
- }
-#endif
+ this->DefaultPlatformName = VSHostPlatformName();
}
}