summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudioGeneratorOptions.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmVisualStudioGeneratorOptions.cxx')
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx48
1 files changed, 18 insertions, 30 deletions
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index c0913e6..dfe5ce6 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -211,6 +211,17 @@ void cmVisualStudioGeneratorOptions::ParseFinish()
}
}
+void cmVisualStudioGeneratorOptions::PrependInheritedString(
+ 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& value = i->second[0];
+ value = "%(" + key + ") " + value;
+}
+
void cmVisualStudioGeneratorOptions::StoreUnknownFlag(const char* flag)
{
// Look for Intel Fortran flags that do not map well in the flag table.
@@ -234,10 +245,10 @@ void cmVisualStudioGeneratorOptions::StoreUnknownFlag(const char* flag)
}
// This option is not known. Store it in the output flags.
- this->FlagString += " ";
- this->FlagString += cmOutputConverter::EscapeWindowsShellArgument(
+ std::string const opts = cmOutputConverter::EscapeWindowsShellArgument(
flag, cmOutputConverter::Shell_Flag_AllowMakeVariables |
cmOutputConverter::Shell_Flag_VSIDE);
+ this->AppendFlagString("AdditionalOptions", opts);
}
void cmVisualStudioGeneratorOptions::SetConfiguration(const char* config)
@@ -252,19 +263,19 @@ void cmVisualStudioGeneratorOptions::OutputPreprocessorDefinitions(
if (this->Defines.empty()) {
return;
}
+ const char* tag = "PreprocessorDefinitions";
if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
// if there are configuration specific flags, then
// use the configuration specific tag for PreprocessorDefinitions
if (!this->Configuration.empty()) {
fout << prefix;
this->TargetGenerator->WritePlatformConfigTag(
- "PreprocessorDefinitions", this->Configuration.c_str(), 0, 0, 0,
- &fout);
+ tag, this->Configuration.c_str(), 0, 0, 0, &fout);
} else {
- fout << prefix << "<PreprocessorDefinitions>";
+ fout << prefix << "<" << tag << ">";
}
} else {
- fout << prefix << "PreprocessorDefinitions=\"";
+ fout << prefix << tag << "=\"";
}
const char* sep = "";
for (std::vector<std::string>::const_iterator di = this->Defines.begin();
@@ -291,7 +302,7 @@ void cmVisualStudioGeneratorOptions::OutputPreprocessorDefinitions(
sep = ";";
}
if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
- fout << ";%(PreprocessorDefinitions)</PreprocessorDefinitions>" << suffix;
+ fout << ";%(" << tag << ")</" << tag << ">" << suffix;
} else {
fout << "\"" << suffix;
}
@@ -332,26 +343,3 @@ void cmVisualStudioGeneratorOptions::OutputFlagMap(std::ostream& fout,
}
}
}
-
-void cmVisualStudioGeneratorOptions::OutputAdditionalOptions(
- std::ostream& fout, const char* prefix, const char* suffix)
-{
- if (!this->FlagString.empty()) {
- if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
- fout << prefix;
- if (!this->Configuration.empty()) {
- this->TargetGenerator->WritePlatformConfigTag(
- "AdditionalOptions", this->Configuration.c_str(), 0, 0, 0, &fout);
- } else {
- fout << "<AdditionalOptions>";
- }
- fout << "%(AdditionalOptions) "
- << cmVisualStudio10GeneratorOptionsEscapeForXML(this->FlagString)
- << "</AdditionalOptions>\n";
- } else {
- fout << prefix << "AdditionalOptions=\"";
- fout << cmVisualStudioGeneratorOptionsEscapeForXML(this->FlagString);
- fout << "\"" << suffix;
- }
- }
-}