CMake/Source/cmVisualStudio10ToolsetOptions.cxx
Brad King bbf216fb6b VS: Add toolset v142 CSharp flag table
While the flag tables for C and C++ were generated from MSBuild `.xml`
files, the CSharp flag tables were written by hand.  Copy the `v141`
flag table to use for the `v142` toolset.

Remove the special case added by commit 626c51f47b (VS: Update for
Visual Studio 2019 Preview 2, 2019-01-24, v3.14.0-rc1~74^2) that mapped
the v142 flag table lookup to v141 since we now have the real v142
table.

Fixes: #19828
2019-10-11 11:11:20 -04:00

144 lines
3.7 KiB
C++

/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmVisualStudio10ToolsetOptions.h"
#include "cmAlgorithms.h"
#include "cmIDEFlagTable.h"
#include "cmVisualStudioGeneratorOptions.h"
std::string cmVisualStudio10ToolsetOptions::GetClFlagTableName(
std::string const& name, std::string const& toolset) const
{
std::string const useToolset = this->GetToolsetName(name, toolset);
if (toolset == "v142") {
return "v142";
} else if (toolset == "v141") {
return "v141";
} else if (useToolset == "v140") {
return "v140";
} else if (useToolset == "v120") {
return "v12";
} else if (useToolset == "v110") {
return "v11";
} else if (useToolset == "v100") {
return "v10";
} else {
return "";
}
}
std::string cmVisualStudio10ToolsetOptions::GetCSharpFlagTableName(
std::string const& name, std::string const& toolset) const
{
std::string const useToolset = this->GetToolsetName(name, toolset);
if (useToolset == "v142") {
return "v142";
} else if (useToolset == "v141") {
return "v141";
} else if (useToolset == "v140") {
return "v140";
} else if (useToolset == "v120") {
return "v12";
} else if (useToolset == "v110") {
return "v11";
} else if (useToolset == "v100") {
return "v10";
} else {
return "";
}
}
std::string cmVisualStudio10ToolsetOptions::GetRcFlagTableName(
std::string const& name, std::string const& toolset) const
{
std::string const useToolset = this->GetToolsetName(name, toolset);
if ((useToolset == "v140") || (useToolset == "v141") ||
(useToolset == "v142")) {
return "v14";
} else if (useToolset == "v120") {
return "v12";
} else if (useToolset == "v110") {
return "v11";
} else if (useToolset == "v100") {
return "v10";
} else {
return "";
}
}
std::string cmVisualStudio10ToolsetOptions::GetLibFlagTableName(
std::string const& name, std::string const& toolset) const
{
std::string const useToolset = this->GetToolsetName(name, toolset);
if ((useToolset == "v140") || (useToolset == "v141") ||
(useToolset == "v142")) {
return "v14";
} else if (useToolset == "v120") {
return "v12";
} else if (useToolset == "v110") {
return "v11";
} else if (useToolset == "v100") {
return "v10";
} else {
return "";
}
}
std::string cmVisualStudio10ToolsetOptions::GetLinkFlagTableName(
std::string const& name, std::string const& toolset) const
{
std::string const useToolset = this->GetToolsetName(name, toolset);
if (useToolset == "v142") {
return "v142";
} else if (useToolset == "v141") {
return "v141";
} else if (useToolset == "v140") {
return "v140";
} else if (useToolset == "v120") {
return "v12";
} else if (useToolset == "v110") {
return "v11";
} else if (useToolset == "v100") {
return "v10";
} else {
return "";
}
}
std::string cmVisualStudio10ToolsetOptions::GetMasmFlagTableName(
std::string const& name, std::string const& toolset) const
{
std::string const useToolset = this->GetToolsetName(name, toolset);
if ((useToolset == "v140") || (useToolset == "v141") ||
(useToolset == "v142")) {
return "v14";
} else if (useToolset == "v120") {
return "v12";
} else if (useToolset == "v110") {
return "v11";
} else if (useToolset == "v100") {
return "v10";
} else {
return "";
}
}
std::string cmVisualStudio10ToolsetOptions::GetToolsetName(
std::string const& name, std::string const& toolset) const
{
static_cast<void>(name);
std::size_t length = toolset.length();
if (cmHasLiteralSuffix(toolset, "_xp")) {
length -= 3;
}
return toolset.substr(0, length);
}