summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudioGeneratorOptions.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmVisualStudioGeneratorOptions.cxx')
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx43
1 files changed, 27 insertions, 16 deletions
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index 058ffb4..9045a4d 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -1,12 +1,18 @@
#include "cmVisualStudioGeneratorOptions.h"
+#include <algorithm>
+#include <map>
+#include <sstream>
+#include <utility>
+#include <vector>
+
#include <cm/iterator>
#include "cmAlgorithms.h"
-#include "cmGeneratorExpression.h"
-#include "cmGeneratorTarget.h"
#include "cmLocalVisualStudioGenerator.h"
#include "cmOutputConverter.h"
+#include "cmRange.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
static void cmVS10EscapeForMSBuild(std::string& ret)
@@ -69,13 +75,13 @@ void cmVisualStudioGeneratorOptions::FixExceptionHandlingDefault()
// the flag to disable exception handling. When the user does
// remove the flag we need to override the IDE default of on.
switch (this->Version) {
- case cmGlobalVisualStudioGenerator::VS10:
- case cmGlobalVisualStudioGenerator::VS11:
- case cmGlobalVisualStudioGenerator::VS12:
- case cmGlobalVisualStudioGenerator::VS14:
- case cmGlobalVisualStudioGenerator::VS15:
- case cmGlobalVisualStudioGenerator::VS16:
- case cmGlobalVisualStudioGenerator::VS17:
+ case cmGlobalVisualStudioGenerator::VSVersion::VS10:
+ case cmGlobalVisualStudioGenerator::VSVersion::VS11:
+ case cmGlobalVisualStudioGenerator::VSVersion::VS12:
+ case cmGlobalVisualStudioGenerator::VSVersion::VS14:
+ case cmGlobalVisualStudioGenerator::VSVersion::VS15:
+ case cmGlobalVisualStudioGenerator::VSVersion::VS16:
+ case cmGlobalVisualStudioGenerator::VSVersion::VS17:
// by default VS puts <ExceptionHandling></ExceptionHandling> empty
// for a project, to make our projects look the same put a new line
// and space over for the closing </ExceptionHandling> as the default
@@ -102,7 +108,8 @@ void cmVisualStudioGeneratorOptions::SetVerboseMakefile(bool verbose)
if (verbose &&
this->FlagMap.find("SuppressStartupBanner") == this->FlagMap.end()) {
this->FlagMap["SuppressStartupBanner"] =
- this->Version < cmGlobalVisualStudioGenerator::VS10 ? "FALSE" : "";
+ this->Version < cmGlobalVisualStudioGenerator::VSVersion::VS10 ? "FALSE"
+ : "";
}
}
@@ -175,6 +182,10 @@ void cmVisualStudioGeneratorOptions::FixCudaCodeGeneration()
// First entries for the -arch=<arch> [-code=<code>,...] pair.
if (!arch.empty()) {
std::string arch_name = arch[0];
+ if (arch_name == "all" || arch_name == "all-major") {
+ AppendFlagString("AdditionalOptions", "-arch=" + arch_name);
+ return;
+ }
std::vector<std::string> codes;
if (!code.empty()) {
codes = cmTokenize(code[0], ",");
@@ -419,7 +430,7 @@ void cmVisualStudioGeneratorOptions::OutputPreprocessorDefinitions(
}
std::ostringstream oss;
- if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
+ if (this->Version >= cmGlobalVisualStudioGenerator::VSVersion::VS10) {
oss << "%(" << tag << ")";
}
std::vector<std::string>::const_iterator de =
@@ -427,13 +438,13 @@ void cmVisualStudioGeneratorOptions::OutputPreprocessorDefinitions(
for (std::string const& di : cmMakeRange(this->Defines.cbegin(), de)) {
// Escape the definition for the compiler.
std::string define;
- if (this->Version < cmGlobalVisualStudioGenerator::VS10) {
+ if (this->Version < cmGlobalVisualStudioGenerator::VSVersion::VS10) {
define = this->LocalGenerator->EscapeForShell(di, true);
} else {
define = di;
}
// Escape this flag for the MSBuild.
- if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
+ if (this->Version >= cmGlobalVisualStudioGenerator::VSVersion::VS10) {
cmVS10EscapeForMSBuild(define);
if (lang == "RC") {
cmSystemTools::ReplaceString(define, "\"", "\\\"");
@@ -475,7 +486,7 @@ void cmVisualStudioGeneratorOptions::OutputAdditionalIncludeDirectories(
}
// Escape this include for the MSBuild.
- if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
+ if (this->Version >= cmGlobalVisualStudioGenerator::VSVersion::VS10) {
cmVS10EscapeForMSBuild(include);
}
oss << sep << include;
@@ -487,7 +498,7 @@ void cmVisualStudioGeneratorOptions::OutputAdditionalIncludeDirectories(
}
}
- if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
+ if (this->Version >= cmGlobalVisualStudioGenerator::VSVersion::VS10) {
oss << sep << "%(" << tag << ")";
}
@@ -501,7 +512,7 @@ void cmVisualStudioGeneratorOptions::OutputFlagMap(std::ostream& fout,
std::ostringstream oss;
const char* sep = "";
for (std::string i : m.second) {
- if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
+ if (this->Version >= cmGlobalVisualStudioGenerator::VSVersion::VS10) {
cmVS10EscapeForMSBuild(i);
}
oss << sep << i;