diff options
Diffstat (limited to 'Source/cmGlobalVisualStudio10Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 49 |
1 files changed, 31 insertions, 18 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 8c20313..a5709d5 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -263,25 +263,32 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset( this->GeneratorToolsetVersion.clear(); } - std::string const toolsetPath = this->GetAuxiliaryToolset(); - if (!toolsetPath.empty() && !cmSystemTools::FileExists(toolsetPath)) { - - std::ostringstream e; - /* clang-format off */ - e << - "Generator\n" - " " << this->GetName() << "\n" - "given toolset and version specification\n" - " " << this->GetPlatformToolsetString() << ",version=" << - this->GeneratorToolsetVersion << "\n" - "does not seem to be installed at\n" << - " " << toolsetPath; - ; - /* clang-format on */ - mf->IssueMessage(cmake::FATAL_ERROR, e.str()); - - // Clear the configured tool-set + bool const isDefaultToolset = + this->IsDefaultToolset(this->GeneratorToolsetVersion); + if (isDefaultToolset) { + // If the given version is the default toolset, remove the setting this->GeneratorToolsetVersion.clear(); + } else { + std::string const toolsetPath = this->GetAuxiliaryToolset(); + if (!toolsetPath.empty() && !cmSystemTools::FileExists(toolsetPath)) { + + std::ostringstream e; + /* clang-format off */ + e << + "Generator\n" + " " << this->GetName() << "\n" + "given toolset and version specification\n" + " " << this->GetPlatformToolsetString() << ",version=" << + this->GeneratorToolsetVersion << "\n" + "does not seem to be installed at\n" << + " " << toolsetPath; + ; + /* clang-format on */ + mf->IssueMessage(cmake::FATAL_ERROR, e.str()); + + // Clear the configured tool-set + this->GeneratorToolsetVersion.clear(); + } } } @@ -615,6 +622,12 @@ cmGlobalVisualStudio10Generator::GetPlatformToolsetCudaString() const return this->GeneratorToolsetCuda; } +bool cmGlobalVisualStudio10Generator::IsDefaultToolset( + const std::string&) const +{ + return true; +} + std::string cmGlobalVisualStudio10Generator::GetAuxiliaryToolset() const { return {}; |