summaryrefslogtreecommitdiff
path: root/Source/cmVisualStudioGeneratorOptions.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-03-07 15:10:30 -0500
committerBrad King <brad.king@kitware.com>2017-03-10 10:19:54 -0500
commitf7bb40c92dceedd65965c4c475b5395239e630ea (patch)
treec16f8ef2716172ebb0dd5b8fca230aac486aa214 /Source/cmVisualStudioGeneratorOptions.cxx
parenta05fc93ee6ce563bbc6bb23e4540cd7bc2f4e52a (diff)
downloadcmake-f7bb40c92dceedd65965c4c475b5395239e630ea.tar.gz
VS: Add method to re-parse specific option parser fields
This will allow a client to parse flags, replace the flag tables, and then re-parse a field in which flags for a secondary tool were collected.
Diffstat (limited to 'Source/cmVisualStudioGeneratorOptions.cxx')
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx18
1 files changed, 17 insertions, 1 deletions
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index 3f9ef949d1..1d20d44d2a 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -43,6 +43,8 @@ cmVisualStudioGeneratorOptions::cmVisualStudioGeneratorOptions(
this->FortranRuntimeDebug = false;
this->FortranRuntimeDLL = false;
this->FortranRuntimeMT = false;
+
+ this->UnknownFlagField = "AdditionalOptions";
}
cmVisualStudioGeneratorOptions::cmVisualStudioGeneratorOptions(
@@ -67,6 +69,8 @@ cmVisualStudioGeneratorOptions::cmVisualStudioGeneratorOptions(
this->FortranRuntimeDebug = false;
this->FortranRuntimeDLL = false;
this->FortranRuntimeMT = false;
+
+ this->UnknownFlagField = "AdditionalOptions";
}
void cmVisualStudioGeneratorOptions::AddTable(cmVS7FlagTable const* table)
@@ -229,6 +233,18 @@ void cmVisualStudioGeneratorOptions::PrependInheritedString(
value = "%(" + key + ") " + value;
}
+void cmVisualStudioGeneratorOptions::Reparse(std::string const& key)
+{
+ std::map<std::string, FlagValue>::iterator i = this->FlagMap.find(key);
+ if (i == this->FlagMap.end() || i->second.size() != 1) {
+ return;
+ }
+ std::string const original = i->second[0];
+ i->second[0] = "";
+ this->UnknownFlagField = key;
+ this->Parse(original.c_str());
+}
+
void cmVisualStudioGeneratorOptions::StoreUnknownFlag(const char* flag)
{
// Look for Intel Fortran flags that do not map well in the flag table.
@@ -255,7 +271,7 @@ void cmVisualStudioGeneratorOptions::StoreUnknownFlag(const char* flag)
std::string const opts = cmOutputConverter::EscapeWindowsShellArgument(
flag, cmOutputConverter::Shell_Flag_AllowMakeVariables |
cmOutputConverter::Shell_Flag_VSIDE);
- this->AppendFlagString("AdditionalOptions", opts);
+ this->AppendFlagString(this->UnknownFlagField, opts);
}
void cmVisualStudioGeneratorOptions::SetConfiguration(const char* config)