VS: Convert GetToolsVersion to non-virtual table lookup

This commit is contained in:
Brad King 2019-01-09 11:21:20 -05:00
parent 757737075a
commit d07f453f39
5 changed files with 22 additions and 10 deletions

View File

@ -1024,6 +1024,27 @@ std::string cmGlobalVisualStudio10Generator::Encoding()
return "utf-8";
}
const char* cmGlobalVisualStudio10Generator::GetToolsVersion() const
{
switch (this->Version) {
case cmGlobalVisualStudioGenerator::VS9:
case cmGlobalVisualStudioGenerator::VS10:
case cmGlobalVisualStudioGenerator::VS11:
return "4.0";
// in Visual Studio 2013 they detached the MSBuild tools version
// from the .Net Framework version and instead made it have it's own
// version number
case cmGlobalVisualStudioGenerator::VS12:
return "12.0";
case cmGlobalVisualStudioGenerator::VS14:
return "14.0";
case cmGlobalVisualStudioGenerator::VS15:
return "15.0";
}
return "";
}
bool cmGlobalVisualStudio10Generator::IsNsightTegra() const
{
return !this->NsightTegraVersion.empty();

View File

@ -104,7 +104,7 @@ public:
std::string const& sfRel);
std::string Encoding() override;
virtual const char* GetToolsVersion() { return "4.0"; }
const char* GetToolsVersion() const;
virtual bool IsDefaultToolset(const std::string& version) const;
virtual std::string GetAuxiliaryToolset() const;

View File

@ -26,11 +26,6 @@ public:
void WriteSLNHeader(std::ostream& fout) override;
// in Visual Studio 2013 they detached the MSBuild tools version
// from the .Net Framework version and instead made it have it's own
// version number
const char* GetToolsVersion() override { return "12.0"; }
protected:
bool ProcessGeneratorToolsetField(std::string const& key,
std::string const& value) override;

View File

@ -26,8 +26,6 @@ public:
void WriteSLNHeader(std::ostream& fout) override;
const char* GetToolsVersion() override { return "14.0"; }
protected:
bool InitializeWindows(cmMakefile* mf) override;
bool InitializeWindowsStore(cmMakefile* mf) override;

View File

@ -26,8 +26,6 @@ public:
void WriteSLNHeader(std::ostream& fout) override;
const char* GetToolsVersion() override { return "15.0"; }
bool SetGeneratorInstance(std::string const& i, cmMakefile* mf) override;
bool GetVSInstance(std::string& dir) const;