cmake/Source/cmVisualStudio10ToolsetOptions.cxx

144 lines
3.7 KiB
C++
Raw Normal View History

2017-04-14 19:02:05 +02:00
/* 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"
2019-11-11 23:01:05 +01:00
std::string cmVisualStudio10ToolsetOptions::GetClFlagTableName(
2017-04-14 19:02:05 +02:00
std::string const& name, std::string const& toolset) const
{
std::string const useToolset = this->GetToolsetName(name, toolset);
2019-11-11 23:01:05 +01:00
if (toolset == "v142") {
return "v142";
} else if (toolset == "v141") {
return "v141";
2017-04-14 19:02:05 +02:00
} else if (useToolset == "v140") {
2019-11-11 23:01:05 +01:00
return "v140";
2017-04-14 19:02:05 +02:00
} else if (useToolset == "v120") {
2019-11-11 23:01:05 +01:00
return "v12";
2017-04-14 19:02:05 +02:00
} else if (useToolset == "v110") {
2019-11-11 23:01:05 +01:00
return "v11";
2017-04-14 19:02:05 +02:00
} else if (useToolset == "v100") {
2019-11-11 23:01:05 +01:00
return "v10";
2017-04-14 19:02:05 +02:00
} else {
2019-11-11 23:01:05 +01:00
return "";
2017-04-14 19:02:05 +02:00
}
}
2019-11-11 23:01:05 +01:00
std::string cmVisualStudio10ToolsetOptions::GetCSharpFlagTableName(
2017-04-14 19:02:05 +02:00
std::string const& name, std::string const& toolset) const
{
std::string const useToolset = this->GetToolsetName(name, toolset);
2019-11-11 23:01:05 +01:00
if (useToolset == "v142") {
2020-02-01 23:06:01 +01:00
return "v142";
2019-11-11 23:01:05 +01:00
} else if (useToolset == "v141") {
return "v141";
2017-04-14 19:02:05 +02:00
} else if (useToolset == "v140") {
2019-11-11 23:01:05 +01:00
return "v140";
2017-04-14 19:02:05 +02:00
} else if (useToolset == "v120") {
2019-11-11 23:01:05 +01:00
return "v12";
2017-04-14 19:02:05 +02:00
} else if (useToolset == "v110") {
2019-11-11 23:01:05 +01:00
return "v11";
2017-04-14 19:02:05 +02:00
} else if (useToolset == "v100") {
2019-11-11 23:01:05 +01:00
return "v10";
2017-04-14 19:02:05 +02:00
} else {
2019-11-11 23:01:05 +01:00
return "";
2017-04-14 19:02:05 +02:00
}
}
2019-11-11 23:01:05 +01:00
std::string cmVisualStudio10ToolsetOptions::GetRcFlagTableName(
2017-04-14 19:02:05 +02:00
std::string const& name, std::string const& toolset) const
{
std::string const useToolset = this->GetToolsetName(name, toolset);
2019-11-11 23:01:05 +01:00
if ((useToolset == "v140") || (useToolset == "v141") ||
(useToolset == "v142")) {
return "v14";
2017-04-14 19:02:05 +02:00
} else if (useToolset == "v120") {
2019-11-11 23:01:05 +01:00
return "v12";
2017-04-14 19:02:05 +02:00
} else if (useToolset == "v110") {
2019-11-11 23:01:05 +01:00
return "v11";
2017-04-14 19:02:05 +02:00
} else if (useToolset == "v100") {
2019-11-11 23:01:05 +01:00
return "v10";
2017-04-14 19:02:05 +02:00
} else {
2019-11-11 23:01:05 +01:00
return "";
2017-04-14 19:02:05 +02:00
}
}
2019-11-11 23:01:05 +01:00
std::string cmVisualStudio10ToolsetOptions::GetLibFlagTableName(
2017-04-14 19:02:05 +02:00
std::string const& name, std::string const& toolset) const
{
std::string const useToolset = this->GetToolsetName(name, toolset);
2019-11-11 23:01:05 +01:00
if ((useToolset == "v140") || (useToolset == "v141") ||
(useToolset == "v142")) {
return "v14";
2017-04-14 19:02:05 +02:00
} else if (useToolset == "v120") {
2019-11-11 23:01:05 +01:00
return "v12";
2017-04-14 19:02:05 +02:00
} else if (useToolset == "v110") {
2019-11-11 23:01:05 +01:00
return "v11";
2017-04-14 19:02:05 +02:00
} else if (useToolset == "v100") {
2019-11-11 23:01:05 +01:00
return "v10";
2017-04-14 19:02:05 +02:00
} else {
2019-11-11 23:01:05 +01:00
return "";
2017-04-14 19:02:05 +02:00
}
}
2019-11-11 23:01:05 +01:00
std::string cmVisualStudio10ToolsetOptions::GetLinkFlagTableName(
2017-04-14 19:02:05 +02:00
std::string const& name, std::string const& toolset) const
{
std::string const useToolset = this->GetToolsetName(name, toolset);
2019-11-11 23:01:05 +01:00
if (useToolset == "v142") {
return "v142";
} else if (useToolset == "v141") {
return "v141";
2017-07-20 19:35:53 +02:00
} else if (useToolset == "v140") {
2019-11-11 23:01:05 +01:00
return "v140";
2017-04-14 19:02:05 +02:00
} else if (useToolset == "v120") {
2019-11-11 23:01:05 +01:00
return "v12";
2017-04-14 19:02:05 +02:00
} else if (useToolset == "v110") {
2019-11-11 23:01:05 +01:00
return "v11";
2017-04-14 19:02:05 +02:00
} else if (useToolset == "v100") {
2019-11-11 23:01:05 +01:00
return "v10";
2017-04-14 19:02:05 +02:00
} else {
2019-11-11 23:01:05 +01:00
return "";
2017-04-14 19:02:05 +02:00
}
}
2019-11-11 23:01:05 +01:00
std::string cmVisualStudio10ToolsetOptions::GetMasmFlagTableName(
2017-04-14 19:02:05 +02:00
std::string const& name, std::string const& toolset) const
{
std::string const useToolset = this->GetToolsetName(name, toolset);
2019-11-11 23:01:05 +01:00
if ((useToolset == "v140") || (useToolset == "v141") ||
(useToolset == "v142")) {
return "v14";
2017-04-14 19:02:05 +02:00
} else if (useToolset == "v120") {
2019-11-11 23:01:05 +01:00
return "v12";
2017-04-14 19:02:05 +02:00
} else if (useToolset == "v110") {
2019-11-11 23:01:05 +01:00
return "v11";
2017-04-14 19:02:05 +02:00
} else if (useToolset == "v100") {
2019-11-11 23:01:05 +01:00
return "v10";
2017-04-14 19:02:05 +02:00
} else {
2019-11-11 23:01:05 +01:00
return "";
2017-04-14 19:02:05 +02:00
}
}
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);
}