cmVisualStudio10ToolsetOptions.cxx 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include "cmVisualStudio10ToolsetOptions.h"
  4. #include "cmAlgorithms.h"
  5. #include "cmIDEFlagTable.h"
  6. #include "cmVisualStudioGeneratorOptions.h"
  7. std::string cmVisualStudio10ToolsetOptions::GetClFlagTableName(
  8. std::string const& name, std::string const& toolset) const
  9. {
  10. std::string const useToolset = this->GetToolsetName(name, toolset);
  11. if (toolset == "v141") {
  12. return "v141";
  13. } else if (useToolset == "v140") {
  14. return "v140";
  15. } else if (useToolset == "v120") {
  16. return "v12";
  17. } else if (useToolset == "v110") {
  18. return "v11";
  19. } else if (useToolset == "v100") {
  20. return "v10";
  21. } else {
  22. return "";
  23. }
  24. }
  25. std::string cmVisualStudio10ToolsetOptions::GetCSharpFlagTableName(
  26. std::string const& name, std::string const& toolset) const
  27. {
  28. std::string const useToolset = this->GetToolsetName(name, toolset);
  29. if ((useToolset == "v141")) {
  30. return "v141";
  31. } else if (useToolset == "v140") {
  32. return "v140";
  33. } else if (useToolset == "v120") {
  34. return "v12";
  35. } else if (useToolset == "v110") {
  36. return "v11";
  37. } else if (useToolset == "v100") {
  38. return "v10";
  39. } else {
  40. return "";
  41. }
  42. }
  43. std::string cmVisualStudio10ToolsetOptions::GetRcFlagTableName(
  44. std::string const& name, std::string const& toolset) const
  45. {
  46. std::string const useToolset = this->GetToolsetName(name, toolset);
  47. if ((useToolset == "v140") || (useToolset == "v141")) {
  48. return "v14";
  49. } else if (useToolset == "v120") {
  50. return "v12";
  51. } else if (useToolset == "v110") {
  52. return "v11";
  53. } else if (useToolset == "v100") {
  54. return "v10";
  55. } else {
  56. return "";
  57. }
  58. }
  59. std::string cmVisualStudio10ToolsetOptions::GetLibFlagTableName(
  60. std::string const& name, std::string const& toolset) const
  61. {
  62. std::string const useToolset = this->GetToolsetName(name, toolset);
  63. if ((useToolset == "v140") || (useToolset == "v141")) {
  64. return "v14";
  65. } else if (useToolset == "v120") {
  66. return "v12";
  67. } else if (useToolset == "v110") {
  68. return "v11";
  69. } else if (useToolset == "v100") {
  70. return "v10";
  71. } else {
  72. return "";
  73. }
  74. }
  75. std::string cmVisualStudio10ToolsetOptions::GetLinkFlagTableName(
  76. std::string const& name, std::string const& toolset) const
  77. {
  78. std::string const useToolset = this->GetToolsetName(name, toolset);
  79. if (useToolset == "v141") {
  80. return "v141";
  81. } else if (useToolset == "v140") {
  82. return "v140";
  83. } else if (useToolset == "v120") {
  84. return "v12";
  85. } else if (useToolset == "v110") {
  86. return "v11";
  87. } else if (useToolset == "v100") {
  88. return "v10";
  89. } else {
  90. return "";
  91. }
  92. }
  93. std::string cmVisualStudio10ToolsetOptions::GetMasmFlagTableName(
  94. std::string const& name, std::string const& toolset) const
  95. {
  96. std::string const useToolset = this->GetToolsetName(name, toolset);
  97. if ((useToolset == "v140") || (useToolset == "v141")) {
  98. return "v14";
  99. } else if (useToolset == "v120") {
  100. return "v12";
  101. } else if (useToolset == "v110") {
  102. return "v11";
  103. } else if (useToolset == "v100") {
  104. return "v10";
  105. } else {
  106. return "";
  107. }
  108. }
  109. std::string cmVisualStudio10ToolsetOptions::GetToolsetName(
  110. std::string const& name, std::string const& toolset) const
  111. {
  112. static_cast<void>(name);
  113. std::size_t length = toolset.length();
  114. if (cmHasLiteralSuffix(toolset, "_xp")) {
  115. length -= 3;
  116. }
  117. return toolset.substr(0, length);
  118. }