diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 179 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.h | 21 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio11Generator.cxx | 18 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio12Generator.cxx | 18 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio14Generator.cxx | 18 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio15Generator.cxx | 9 | ||||
-rw-r--r-- | Source/cmVisualStudio10ToolsetOptions.cxx | 124 | ||||
-rw-r--r-- | Source/cmVisualStudio10ToolsetOptions.h | 32 |
8 files changed, 242 insertions, 177 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 82fcaad..c9c6938 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -8,19 +8,11 @@ #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" #include "cmSourceFile.h" -#include "cmVS10CLFlagTable.h" -#include "cmVS10CSharpFlagTable.h" -#include "cmVS10CudaFlagTable.h" -#include "cmVS10CudaHostFlagTable.h" -#include "cmVS10LibFlagTable.h" -#include "cmVS10LinkFlagTable.h" -#include "cmVS10MASMFlagTable.h" -#include "cmVS10NASMFlagTable.h" -#include "cmVS10RCFlagTable.h" #include "cmVersion.h" #include "cmVisualStudioSlnData.h" #include "cmVisualStudioSlnParser.h" #include "cmXMLWriter.h" +#include "cm_jsoncpp_reader.h" #include "cmake.h" #include "cmsys/FStream.hxx" @@ -30,6 +22,7 @@ #include <algorithm> static const char vs10generatorName[] = "Visual Studio 10 2010"; +static std::map<std::string, std::vector<cmIDEFlagTable>> loadedFlagJsonFiles; // Map generator name without year to name with year. static const char* cmVS10GenName(const std::string& name, std::string& genName) @@ -120,15 +113,16 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator( this->DefaultPlatformToolset = "v100"; } } - this->DefaultClFlagTable = cmVS10CLFlagTable; - this->DefaultCSharpFlagTable = cmVS10CSharpFlagTable; - this->DefaultLibFlagTable = cmVS10LibFlagTable; - this->DefaultLinkFlagTable = cmVS10LinkFlagTable; - this->DefaultCudaFlagTable = cmVS10CudaFlagTable; - this->DefaultCudaHostFlagTable = cmVS10CudaHostFlagTable; - this->DefaultMasmFlagTable = cmVS10MASMFlagTable; - this->DefaultNasmFlagTable = cmVS10NASMFlagTable; - this->DefaultRcFlagTable = cmVS10RCFlagTable; + this->DefaultCLFlagTableName = "v10"; + this->DefaultCSharpFlagTableName = "v10"; + this->DefaultLibFlagTableName = "v10"; + this->DefaultLinkFlagTableName = "v10"; + this->DefaultCudaFlagTableName = "v10"; + this->DefaultCudaHostFlagTableName = "v10"; + this->DefaultMasmFlagTableName = "v10"; + this->DefaultNasmFlagTableName = "v10"; + this->DefaultRCFlagTableName = "v10"; + this->Version = VS10; this->PlatformToolsetNeedsDebugEnum = false; } @@ -1050,67 +1044,174 @@ std::string cmGlobalVisualStudio10Generator::GetInstalledNsightTegraVersion() return version; } +static std::string cmLoadFlagTableString(Json::Value entry, const char* field) +{ + if (entry.isMember(field)) { + auto string = entry[field]; + if (string.isConvertibleTo(Json::ValueType::stringValue)) { + return string.asString(); + } + } + return ""; +} + +static unsigned int cmLoadFlagTableSpecial(Json::Value entry, + const char* field) +{ + unsigned int value = 0; + if (entry.isMember(field)) { + auto specials = entry[field]; + if (specials.isArray()) { + for (auto const& special : specials) { + std::string s = special.asString(); + if (s == "UserValue") { + value |= cmIDEFlagTable::UserValue; + } else if (s == "UserIgnored") { + value |= cmIDEFlagTable::UserIgnored; + } else if (s == "UserRequired") { + value |= cmIDEFlagTable::UserRequired; + } else if (s == "Continue") { + value |= cmIDEFlagTable::Continue; + } else if (s == "SemicolonAppendable") { + value |= cmIDEFlagTable::SemicolonAppendable; + } else if (s == "UserFollowing") { + value |= cmIDEFlagTable::UserFollowing; + } else if (s == "CaseInsensitive") { + value |= cmIDEFlagTable::CaseInsensitive; + } else if (s == "SpaceAppendable") { + value |= cmIDEFlagTable::SpaceAppendable; + } + } + } + } + return value; +} + +static cmIDEFlagTable const* cmLoadFlagTableJson( + std::string const& flagJsonPath) +{ + cmIDEFlagTable* ret = nullptr; + auto savedFlagIterator = loadedFlagJsonFiles.find(flagJsonPath); + if (savedFlagIterator != loadedFlagJsonFiles.end()) { + ret = savedFlagIterator->second.data(); + } else { + Json::Reader reader; + cmsys::ifstream stream; + + stream.open(flagJsonPath.c_str(), std::ios_base::in); + if (stream) { + Json::Value flags; + if (reader.parse(stream, flags, false) && flags.isArray()) { + std::vector<cmIDEFlagTable> flagTable; + for (auto const& flag : flags) { + cmIDEFlagTable flagEntry; + flagEntry.IDEName = cmLoadFlagTableString(flag, "name"); + flagEntry.commandFlag = cmLoadFlagTableString(flag, "switch"); + flagEntry.comment = cmLoadFlagTableString(flag, "comment"); + flagEntry.value = cmLoadFlagTableString(flag, "value"); + flagEntry.special = cmLoadFlagTableSpecial(flag, "flags"); + flagTable.push_back(flagEntry); + } + cmIDEFlagTable endFlag{ "", "", "", "", 0 }; + flagTable.push_back(endFlag); + + loadedFlagJsonFiles[flagJsonPath] = flagTable; + ret = loadedFlagJsonFiles[flagJsonPath].data(); + } + } + } + return ret; +} + +cmIDEFlagTable const* cmGlobalVisualStudio10Generator::LoadFlagTable( + std::string const& flagTableName, std::string const& table) const +{ + cmIDEFlagTable const* ret = nullptr; + + std::string filename = cmSystemTools::GetCMakeRoot() + + "/Templates/MSBuild/FlagTables/" + flagTableName + "_" + table + ".json"; + ret = cmLoadFlagTableJson(filename); + + if (!ret) { + cmMakefile* mf = this->GetCurrentMakefile(); + + std::ostringstream e; + /* clang-format off */ + e << "JSON flag table \"" << filename << + "\" could not be loaded.\n"; + /* clang-format on */ + mf->IssueMessage(cmake::FATAL_ERROR, e.str().c_str()); + } + return ret; +} + cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetClFlagTable() const { - cmIDEFlagTable const* table = this->ToolsetOptions.GetClFlagTable( - this->GetPlatformName(), this->GetPlatformToolsetString()); + std::string flagTableName = this->ToolsetOptions.GetClFlagTableName( + this->GetPlatformName(), this->GetPlatformToolsetString(), + this->DefaultCLFlagTableName); - return (table != nullptr) ? table : this->DefaultClFlagTable; + return LoadFlagTable(flagTableName, "CL"); } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetCSharpFlagTable() const { - cmIDEFlagTable const* table = this->ToolsetOptions.GetCSharpFlagTable( - this->GetPlatformName(), this->GetPlatformToolsetString()); + std::string flagTableName = this->ToolsetOptions.GetCSharpFlagTableName( + this->GetPlatformName(), this->GetPlatformToolsetString(), + this->DefaultCSharpFlagTableName); - return (table != nullptr) ? table : this->DefaultCSharpFlagTable; + return LoadFlagTable(flagTableName, "CSharp"); } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetRcFlagTable() const { - cmIDEFlagTable const* table = this->ToolsetOptions.GetRcFlagTable( - this->GetPlatformName(), this->GetPlatformToolsetString()); + std::string flagTableName = this->ToolsetOptions.GetRcFlagTableName( + this->GetPlatformName(), this->GetPlatformToolsetString(), + this->DefaultRCFlagTableName); - return (table != nullptr) ? table : this->DefaultRcFlagTable; + return LoadFlagTable(flagTableName, "RC"); } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetLibFlagTable() const { - cmIDEFlagTable const* table = this->ToolsetOptions.GetLibFlagTable( - this->GetPlatformName(), this->GetPlatformToolsetString()); + std::string flagTableName = this->ToolsetOptions.GetLibFlagTableName( + this->GetPlatformName(), this->GetPlatformToolsetString(), + this->DefaultLibFlagTableName); - return (table != nullptr) ? table : this->DefaultLibFlagTable; + return LoadFlagTable(flagTableName, "LIB"); } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetLinkFlagTable() const { - cmIDEFlagTable const* table = this->ToolsetOptions.GetLinkFlagTable( - this->GetPlatformName(), this->GetPlatformToolsetString()); + std::string flagTableName = this->ToolsetOptions.GetLinkFlagTableName( + this->GetPlatformName(), this->GetPlatformToolsetString(), + this->DefaultLinkFlagTableName); - return (table != nullptr) ? table : this->DefaultLinkFlagTable; + return LoadFlagTable(flagTableName, "Link"); } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetCudaFlagTable() const { - return this->DefaultCudaFlagTable; + return LoadFlagTable(this->DefaultCudaFlagTableName, "Cuda"); } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetCudaHostFlagTable() const { - return this->DefaultCudaHostFlagTable; + return LoadFlagTable(this->DefaultCudaHostFlagTableName, "CudaHost"); } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetMasmFlagTable() const { - cmIDEFlagTable const* table = this->ToolsetOptions.GetMasmFlagTable( - this->GetPlatformName(), this->GetPlatformToolsetString()); + std::string flagTableName = this->ToolsetOptions.GetMasmFlagTableName( + this->GetPlatformName(), this->GetPlatformToolsetString(), + this->DefaultMasmFlagTableName); - return (table != nullptr) ? table : this->DefaultMasmFlagTable; + return LoadFlagTable(flagTableName, "MASM"); } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetNasmFlagTable() const { - return this->DefaultNasmFlagTable; + return LoadFlagTable(this->DefaultNasmFlagTableName, "NASM"); } diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 63e6903..6c4a9e6 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -144,6 +144,9 @@ protected: std::string const& GetMSBuildCommand(); + cmIDEFlagTable const* LoadFlagTable(std::string const& flagTableName, + std::string const& table) const; + std::string GeneratorToolset; std::string GeneratorToolsetVersion; std::string GeneratorToolsetHostArchitecture; @@ -153,15 +156,15 @@ protected: std::string SystemName; std::string SystemVersion; std::string NsightTegraVersion; - cmIDEFlagTable const* DefaultClFlagTable; - cmIDEFlagTable const* DefaultCSharpFlagTable; - cmIDEFlagTable const* DefaultLibFlagTable; - cmIDEFlagTable const* DefaultLinkFlagTable; - cmIDEFlagTable const* DefaultCudaFlagTable; - cmIDEFlagTable const* DefaultCudaHostFlagTable; - cmIDEFlagTable const* DefaultMasmFlagTable; - cmIDEFlagTable const* DefaultNasmFlagTable; - cmIDEFlagTable const* DefaultRcFlagTable; + std::string DefaultCLFlagTableName; + std::string DefaultCSharpFlagTableName; + std::string DefaultLibFlagTableName; + std::string DefaultLinkFlagTableName; + std::string DefaultCudaFlagTableName; + std::string DefaultCudaHostFlagTableName; + std::string DefaultMasmFlagTableName; + std::string DefaultNasmFlagTableName; + std::string DefaultRCFlagTableName; bool SystemIsWindowsCE; bool SystemIsWindowsPhone; bool SystemIsWindowsStore; diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index f1d5a8c..e40023d 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -6,12 +6,6 @@ #include "cmDocumentationEntry.h" #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" -#include "cmVS11CLFlagTable.h" -#include "cmVS11CSharpFlagTable.h" -#include "cmVS11LibFlagTable.h" -#include "cmVS11LinkFlagTable.h" -#include "cmVS11MASMFlagTable.h" -#include "cmVS11RCFlagTable.h" static const char vs11generatorName[] = "Visual Studio 11 2012"; @@ -107,12 +101,12 @@ cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator( "ProductDir", vc11Express, cmSystemTools::KeyWOW64_32); this->DefaultPlatformToolset = "v110"; - this->DefaultClFlagTable = cmVS11CLFlagTable; - this->DefaultCSharpFlagTable = cmVS11CSharpFlagTable; - this->DefaultLibFlagTable = cmVS11LibFlagTable; - this->DefaultLinkFlagTable = cmVS11LinkFlagTable; - this->DefaultMasmFlagTable = cmVS11MASMFlagTable; - this->DefaultRcFlagTable = cmVS11RCFlagTable; + this->DefaultCLFlagTableName = "v11"; + this->DefaultCSharpFlagTableName = "v11"; + this->DefaultLibFlagTableName = "v11"; + this->DefaultLinkFlagTableName = "v11"; + this->DefaultMasmFlagTableName = "v11"; + this->DefaultRCFlagTableName = "v11"; this->Version = VS11; } diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx index e05ae70..3be7d24 100644 --- a/Source/cmGlobalVisualStudio12Generator.cxx +++ b/Source/cmGlobalVisualStudio12Generator.cxx @@ -6,12 +6,6 @@ #include "cmDocumentationEntry.h" #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" -#include "cmVS12CLFlagTable.h" -#include "cmVS12CSharpFlagTable.h" -#include "cmVS12LibFlagTable.h" -#include "cmVS12LinkFlagTable.h" -#include "cmVS12MASMFlagTable.h" -#include "cmVS12RCFlagTable.h" static const char vs12generatorName[] = "Visual Studio 12 2013"; @@ -90,12 +84,12 @@ cmGlobalVisualStudio12Generator::cmGlobalVisualStudio12Generator( "ProductDir", vc12Express, cmSystemTools::KeyWOW64_32); this->DefaultPlatformToolset = "v120"; - this->DefaultClFlagTable = cmVS12CLFlagTable; - this->DefaultCSharpFlagTable = cmVS12CSharpFlagTable; - this->DefaultLibFlagTable = cmVS12LibFlagTable; - this->DefaultLinkFlagTable = cmVS12LinkFlagTable; - this->DefaultMasmFlagTable = cmVS12MASMFlagTable; - this->DefaultRcFlagTable = cmVS12RCFlagTable; + this->DefaultCLFlagTableName = "v12"; + this->DefaultCSharpFlagTableName = "v12"; + this->DefaultLibFlagTableName = "v12"; + this->DefaultLinkFlagTableName = "v12"; + this->DefaultMasmFlagTableName = "v12"; + this->DefaultRCFlagTableName = "v12"; this->Version = VS12; } diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index c3ddb3e..9647f78 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -6,12 +6,6 @@ #include "cmDocumentationEntry.h" #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" -#include "cmVS140CLFlagTable.h" -#include "cmVS140CSharpFlagTable.h" -#include "cmVS140LinkFlagTable.h" -#include "cmVS14LibFlagTable.h" -#include "cmVS14MASMFlagTable.h" -#include "cmVS14RCFlagTable.h" static const char vs14generatorName[] = "Visual Studio 14 2015"; @@ -90,12 +84,12 @@ cmGlobalVisualStudio14Generator::cmGlobalVisualStudio14Generator( "ProductDir", vc14Express, cmSystemTools::KeyWOW64_32); this->DefaultPlatformToolset = "v140"; - this->DefaultClFlagTable = cmVS140CLFlagTable; - this->DefaultCSharpFlagTable = cmVS140CSharpFlagTable; - this->DefaultLibFlagTable = cmVS14LibFlagTable; - this->DefaultLinkFlagTable = cmVS140LinkFlagTable; - this->DefaultMasmFlagTable = cmVS14MASMFlagTable; - this->DefaultRcFlagTable = cmVS14RCFlagTable; + this->DefaultCLFlagTableName = "v140"; + this->DefaultCSharpFlagTableName = "v140"; + this->DefaultLibFlagTableName = "v14"; + this->DefaultLinkFlagTableName = "v140"; + this->DefaultMasmFlagTableName = "v14"; + this->DefaultRCFlagTableName = "v14"; this->Version = VS14; } diff --git a/Source/cmGlobalVisualStudio15Generator.cxx b/Source/cmGlobalVisualStudio15Generator.cxx index 23fd2d5..2853283 100644 --- a/Source/cmGlobalVisualStudio15Generator.cxx +++ b/Source/cmGlobalVisualStudio15Generator.cxx @@ -6,9 +6,6 @@ #include "cmDocumentationEntry.h" #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" -#include "cmVS141CLFlagTable.h" -#include "cmVS141CSharpFlagTable.h" -#include "cmVS141LinkFlagTable.h" #include "cmVSSetupHelper.h" static const char vs15generatorName[] = "Visual Studio 15 2017"; @@ -84,9 +81,9 @@ cmGlobalVisualStudio15Generator::cmGlobalVisualStudio15Generator( { this->ExpressEdition = false; this->DefaultPlatformToolset = "v141"; - this->DefaultClFlagTable = cmVS141CLFlagTable; - this->DefaultCSharpFlagTable = cmVS141CSharpFlagTable; - this->DefaultLinkFlagTable = cmVS141LinkFlagTable; + this->DefaultCLFlagTableName = "v141"; + this->DefaultCSharpFlagTableName = "v141"; + this->DefaultLinkFlagTableName = "v141"; this->Version = VS15; } diff --git a/Source/cmVisualStudio10ToolsetOptions.cxx b/Source/cmVisualStudio10ToolsetOptions.cxx index 9a1d950..f71b8b7 100644 --- a/Source/cmVisualStudio10ToolsetOptions.cxx +++ b/Source/cmVisualStudio10ToolsetOptions.cxx @@ -6,145 +6,123 @@ #include "cmIDEFlagTable.h" #include "cmVisualStudioGeneratorOptions.h" -#include "cmVS10CLFlagTable.h" -#include "cmVS10CSharpFlagTable.h" -#include "cmVS10LibFlagTable.h" -#include "cmVS10LinkFlagTable.h" -#include "cmVS10MASMFlagTable.h" -#include "cmVS10RCFlagTable.h" -#include "cmVS11CLFlagTable.h" -#include "cmVS11CSharpFlagTable.h" -#include "cmVS11LibFlagTable.h" -#include "cmVS11LinkFlagTable.h" -#include "cmVS11MASMFlagTable.h" -#include "cmVS11RCFlagTable.h" -#include "cmVS12CLFlagTable.h" -#include "cmVS12CSharpFlagTable.h" -#include "cmVS12LibFlagTable.h" -#include "cmVS12LinkFlagTable.h" -#include "cmVS12MASMFlagTable.h" -#include "cmVS12RCFlagTable.h" -#include "cmVS140CLFlagTable.h" -#include "cmVS140CSharpFlagTable.h" -#include "cmVS140LinkFlagTable.h" -#include "cmVS141CLFlagTable.h" -#include "cmVS141CSharpFlagTable.h" -#include "cmVS141LinkFlagTable.h" -#include "cmVS14LibFlagTable.h" -#include "cmVS14MASMFlagTable.h" -#include "cmVS14RCFlagTable.h" - -cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetClFlagTable( - std::string const& name, std::string const& toolset) const +std::string cmVisualStudio10ToolsetOptions::GetClFlagTableName( + std::string const& name, std::string const& toolset, + std::string const& defaultToolset) const { std::string const useToolset = this->GetToolsetName(name, toolset); if (toolset == "v141") { - return cmVS141CLFlagTable; + return "v141"; } else if (useToolset == "v140") { - return cmVS140CLFlagTable; + return "v140"; } else if (useToolset == "v120") { - return cmVS12CLFlagTable; + return "v12"; } else if (useToolset == "v110") { - return cmVS11CLFlagTable; + return "v11"; } else if (useToolset == "v100") { - return cmVS10CLFlagTable; + return "v10"; } else { - return 0; + return this->GetToolsetName(name, defaultToolset); } } -cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetCSharpFlagTable( - std::string const& name, std::string const& toolset) const +std::string cmVisualStudio10ToolsetOptions::GetCSharpFlagTableName( + std::string const& name, std::string const& toolset, + std::string const& defaultToolset) const { std::string const useToolset = this->GetToolsetName(name, toolset); if ((useToolset == "v141")) { - return cmVS141CSharpFlagTable; + return "v141"; } else if (useToolset == "v140") { - return cmVS140CSharpFlagTable; + return "v140"; } else if (useToolset == "v120") { - return cmVS12CSharpFlagTable; + return "v12"; } else if (useToolset == "v110") { - return cmVS11CSharpFlagTable; + return "v11"; } else if (useToolset == "v100") { - return cmVS10CSharpFlagTable; + return "v10"; } else { - return 0; + return this->GetToolsetName(name, defaultToolset); } } -cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetRcFlagTable( - std::string const& name, std::string const& toolset) const +std::string cmVisualStudio10ToolsetOptions::GetRcFlagTableName( + std::string const& name, std::string const& toolset, + std::string const& defaultToolset) const { std::string const useToolset = this->GetToolsetName(name, toolset); if ((useToolset == "v140") || (useToolset == "v141")) { - return cmVS14RCFlagTable; + return "v14"; } else if (useToolset == "v120") { - return cmVS12RCFlagTable; + return "v12"; } else if (useToolset == "v110") { - return cmVS11RCFlagTable; + return "v11"; } else if (useToolset == "v100") { - return cmVS10RCFlagTable; + return "v10"; } else { - return 0; + return this->GetToolsetName(name, defaultToolset); } } -cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetLibFlagTable( - std::string const& name, std::string const& toolset) const +std::string cmVisualStudio10ToolsetOptions::GetLibFlagTableName( + std::string const& name, std::string const& toolset, + std::string const& defaultToolset) const { std::string const useToolset = this->GetToolsetName(name, toolset); if ((useToolset == "v140") || (useToolset == "v141")) { - return cmVS14LibFlagTable; + return "v14"; } else if (useToolset == "v120") { - return cmVS12LibFlagTable; + return "v12"; } else if (useToolset == "v110") { - return cmVS11LibFlagTable; + return "v11"; } else if (useToolset == "v100") { - return cmVS10LibFlagTable; + return "v10"; } else { - return 0; + return this->GetToolsetName(name, defaultToolset); } } -cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetLinkFlagTable( - std::string const& name, std::string const& toolset) const +std::string cmVisualStudio10ToolsetOptions::GetLinkFlagTableName( + std::string const& name, std::string const& toolset, + std::string const& defaultToolset) const { std::string const useToolset = this->GetToolsetName(name, toolset); if (useToolset == "v141") { - return cmVS141LinkFlagTable; + return "v141"; } else if (useToolset == "v140") { - return cmVS140LinkFlagTable; + return "v140"; } else if (useToolset == "v120") { - return cmVS12LinkFlagTable; + return "v12"; } else if (useToolset == "v110") { - return cmVS11LinkFlagTable; + return "v11"; } else if (useToolset == "v100") { - return cmVS10LinkFlagTable; + return "v10"; } else { - return 0; + return this->GetToolsetName(name, defaultToolset); } } -cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetMasmFlagTable( - std::string const& name, std::string const& toolset) const +std::string cmVisualStudio10ToolsetOptions::GetMasmFlagTableName( + std::string const& name, std::string const& toolset, + std::string const& defaultToolset) const { std::string const useToolset = this->GetToolsetName(name, toolset); if ((useToolset == "v140") || (useToolset == "v141")) { - return cmVS14MASMFlagTable; + return "v14"; } else if (useToolset == "v120") { - return cmVS12MASMFlagTable; + return "v12"; } else if (useToolset == "v110") { - return cmVS11MASMFlagTable; + return "v11"; } else if (useToolset == "v100") { - return cmVS10MASMFlagTable; + return "v10"; } else { - return 0; + return this->GetToolsetName(name, defaultToolset); } } diff --git a/Source/cmVisualStudio10ToolsetOptions.h b/Source/cmVisualStudio10ToolsetOptions.h index c736a49..43946f0 100644 --- a/Source/cmVisualStudio10ToolsetOptions.h +++ b/Source/cmVisualStudio10ToolsetOptions.h @@ -7,8 +7,6 @@ #include <string> -struct cmIDEFlagTable; - /** \class cmVisualStudio10ToolsetOptions * \brief Retrieves toolset options for MSBuild. * @@ -17,18 +15,24 @@ struct cmIDEFlagTable; class cmVisualStudio10ToolsetOptions { public: - cmIDEFlagTable const* GetClFlagTable(std::string const& name, - std::string const& toolset) const; - cmIDEFlagTable const* GetCSharpFlagTable(std::string const& name, - std::string const& toolset) const; - cmIDEFlagTable const* GetRcFlagTable(std::string const& name, - std::string const& toolset) const; - cmIDEFlagTable const* GetLibFlagTable(std::string const& name, - std::string const& toolset) const; - cmIDEFlagTable const* GetLinkFlagTable(std::string const& name, - std::string const& toolset) const; - cmIDEFlagTable const* GetMasmFlagTable(std::string const& name, - std::string const& toolset) const; + std::string GetClFlagTableName(std::string const& name, + std::string const& toolset, + std::string const& defaultToolset) const; + std::string GetCSharpFlagTableName(std::string const& name, + std::string const& toolset, + std::string const& defaultToolset) const; + std::string GetRcFlagTableName(std::string const& name, + std::string const& toolset, + std::string const& defaultToolset) const; + std::string GetLibFlagTableName(std::string const& name, + std::string const& toolset, + std::string const& defaultToolset) const; + std::string GetLinkFlagTableName(std::string const& name, + std::string const& toolset, + std::string const& defaultToolset) const; + std::string GetMasmFlagTableName(std::string const& name, + std::string const& toolset, + std::string const& defaultToolset) const; private: std::string GetToolsetName(std::string const& name, |