mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-07 22:30:13 -06:00
VS: Factor out helper function to compute host platform name
This commit is contained in:
@@ -19,6 +19,20 @@
|
|||||||
# include "cmsys/SystemInformation.hxx"
|
# include "cmsys/SystemInformation.hxx"
|
||||||
#endif
|
#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(
|
static unsigned int VSVersionToMajor(
|
||||||
cmGlobalVisualStudioGenerator::VSVersion v)
|
cmGlobalVisualStudioGenerator::VSVersion v)
|
||||||
{
|
{
|
||||||
@@ -206,16 +220,7 @@ cmGlobalVisualStudioVersionedGenerator::cmGlobalVisualStudioVersionedGenerator(
|
|||||||
this->DefaultCSharpFlagTableName = VSVersionToToolset(this->Version);
|
this->DefaultCSharpFlagTableName = VSVersionToToolset(this->Version);
|
||||||
this->DefaultLinkFlagTableName = VSVersionToToolset(this->Version);
|
this->DefaultLinkFlagTableName = VSVersionToToolset(this->Version);
|
||||||
if (this->Version >= cmGlobalVisualStudioGenerator::VS16) {
|
if (this->Version >= cmGlobalVisualStudioGenerator::VS16) {
|
||||||
#ifdef HOST_PLATFORM_NAME
|
this->DefaultPlatformName = VSHostPlatformName();
|
||||||
this->DefaultPlatformName = HOST_PLATFORM_NAME;
|
|
||||||
#else
|
|
||||||
cmsys::SystemInformation info;
|
|
||||||
if (info.Is64Bits()) {
|
|
||||||
this->DefaultPlatformName = "x64";
|
|
||||||
} else {
|
|
||||||
this->DefaultPlatformName = "Win32";
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user