diff options
author | Brad King <brad.king@kitware.com> | 2019-01-09 16:21:20 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-01-10 12:51:47 (GMT) |
commit | d07f453f39b477d687dd87aad2e1cd766598b434 (patch) | |
tree | 47513af9e917f5c23465c4ee62e39865c85dfe24 | |
parent | 757737075a3f998c9ecc93f5c467dabe4b005fee (diff) | |
download | CMake-d07f453f39b477d687dd87aad2e1cd766598b434.zip CMake-d07f453f39b477d687dd87aad2e1cd766598b434.tar.gz CMake-d07f453f39b477d687dd87aad2e1cd766598b434.tar.bz2 |
VS: Convert GetToolsVersion to non-virtual table lookup
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 21 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio12Generator.h | 5 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio14Generator.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio15Generator.h | 2 |
5 files changed, 22 insertions, 10 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index c9c6938..6be1e23 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -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(); diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index dc49ded..5c8ab1c 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -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; diff --git a/Source/cmGlobalVisualStudio12Generator.h b/Source/cmGlobalVisualStudio12Generator.h index ae78de7..2e1e00c 100644 --- a/Source/cmGlobalVisualStudio12Generator.h +++ b/Source/cmGlobalVisualStudio12Generator.h @@ -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; diff --git a/Source/cmGlobalVisualStudio14Generator.h b/Source/cmGlobalVisualStudio14Generator.h index 4bc430b..8edd018 100644 --- a/Source/cmGlobalVisualStudio14Generator.h +++ b/Source/cmGlobalVisualStudio14Generator.h @@ -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; diff --git a/Source/cmGlobalVisualStudio15Generator.h b/Source/cmGlobalVisualStudio15Generator.h index 68aa14f..6bf95c3 100644 --- a/Source/cmGlobalVisualStudio15Generator.h +++ b/Source/cmGlobalVisualStudio15Generator.h @@ -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; |