diff options
author | Brad King <brad.king@kitware.com> | 2019-01-28 15:49:16 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-01-28 17:58:21 (GMT) |
commit | 0fd742a6ffa637b8ccac3b61b42bd10b2c3a87cc (patch) | |
tree | 3f264f210f2e7ab523433b4f87509e581c7e9110 /Source/cmGlobalVisualStudio10Generator.cxx | |
parent | 17cef3806d958bd03ec08b925fe585a0cfa204fa (diff) | |
download | CMake-0fd742a6ffa637b8ccac3b61b42bd10b2c3a87cc.zip CMake-0fd742a6ffa637b8ccac3b61b42bd10b2c3a87cc.tar.gz CMake-0fd742a6ffa637b8ccac3b61b42bd10b2c3a87cc.tar.bz2 |
VS: Teach VS 2019 generator to select host tools matching host arch
This generator is new so we can introduce the long-desired behavior
of selecting ``host=x64`` tools by default on x64 hosts.
Diffstat (limited to 'Source/cmGlobalVisualStudio10Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 4dae479..99e9173 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -607,10 +607,26 @@ cmGlobalVisualStudio10Generator::GetPlatformToolsetVersionString() const const char* cmGlobalVisualStudio10Generator::GetPlatformToolsetHostArchitecture() const { + std::string const& hostArch = + this->GetPlatformToolsetHostArchitectureString(); + if (hostArch.empty()) { + return nullptr; + } + return hostArch.c_str(); +} + +std::string const& +cmGlobalVisualStudio10Generator::GetPlatformToolsetHostArchitectureString() + const +{ if (!this->GeneratorToolsetHostArchitecture.empty()) { - return this->GeneratorToolsetHostArchitecture.c_str(); + return this->GeneratorToolsetHostArchitecture; } - return nullptr; + if (!this->DefaultPlatformToolsetHostArchitecture.empty()) { + return this->DefaultPlatformToolsetHostArchitecture; + } + static std::string const empty; + return empty; } const char* cmGlobalVisualStudio10Generator::GetPlatformToolsetCuda() const |