diff options
author | Brad King <brad.king@kitware.com> | 2019-01-10 13:43:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-01-10 14:38:35 (GMT) |
commit | 89cc3d432bc576d00cb12880b37ec8b348599897 (patch) | |
tree | 45d74c1605d34d6c2ad289d6572f3084b81cbb50 /Source/cmGlobalVisualStudioGenerator.cxx | |
parent | 40a732800d52b394d7bd4a81e9aaef04ef5914e6 (diff) | |
download | CMake-89cc3d432bc576d00cb12880b37ec8b348599897.zip CMake-89cc3d432bc576d00cb12880b37ec8b348599897.tar.gz CMake-89cc3d432bc576d00cb12880b37ec8b348599897.tar.bz2 |
VS: Move platform name members to top-level global generator
We no longer support any VS versions that pre-date support for
multiple platforms (target architectures).
Diffstat (limited to 'Source/cmGlobalVisualStudioGenerator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.cxx | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index adf0a81..4828c8a 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -20,12 +20,19 @@ #include "cmState.h" #include "cmTarget.h" -cmGlobalVisualStudioGenerator::cmGlobalVisualStudioGenerator(cmake* cm) +cmGlobalVisualStudioGenerator::cmGlobalVisualStudioGenerator( + cmake* cm, std::string const& platformInGeneratorName) : cmGlobalGenerator(cm) { cm->GetState()->SetIsGeneratorMultiConfig(true); cm->GetState()->SetWindowsShell(true); cm->GetState()->SetWindowsVSIDE(true); + + if (platformInGeneratorName.empty()) { + this->DefaultPlatformName = "Win32"; + } else { + this->DefaultPlatformName = platformInGeneratorName; + } } cmGlobalVisualStudioGenerator::~cmGlobalVisualStudioGenerator() @@ -43,6 +50,26 @@ void cmGlobalVisualStudioGenerator::SetVersion(VSVersion v) this->Version = v; } +bool cmGlobalVisualStudioGenerator::SetGeneratorPlatform(std::string const& p, + cmMakefile* mf) +{ + if (this->GetPlatformName() == "x64") { + mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE"); + } else if (this->GetPlatformName() == "Itanium") { + mf->AddDefinition("CMAKE_FORCE_IA64", "TRUE"); + } + mf->AddDefinition("CMAKE_VS_PLATFORM_NAME", this->GetPlatformName().c_str()); + return this->cmGlobalGenerator::SetGeneratorPlatform(p, mf); +} + +std::string const& cmGlobalVisualStudioGenerator::GetPlatformName() const +{ + if (!this->GeneratorPlatform.empty()) { + return this->GeneratorPlatform; + } + return this->DefaultPlatformName; +} + const char* cmGlobalVisualStudioGenerator::GetIDEVersion() const { switch (this->Version) { |