diff options
author | Brad King <brad.king@kitware.com> | 2017-02-15 15:40:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-02-15 15:41:36 (GMT) |
commit | 109b8a6fd32be9886de71f98170e0c512ac9883f (patch) | |
tree | 092fe04e949e31e691bae6b18f4b69fe9ca08fe4 /Source/cmVisualStudioGeneratorOptions.cxx | |
parent | bd5ea6993c8376cd3612100019e15ee256a758d8 (diff) | |
download | CMake-109b8a6fd32be9886de71f98170e0c512ac9883f.zip CMake-109b8a6fd32be9886de71f98170e0c512ac9883f.tar.gz CMake-109b8a6fd32be9886de71f98170e0c512ac9883f.tar.bz2 |
VS: Refactor AdditionalOptions generation
Store unknown flags directly in a flag map entry for `AdditionalOptions`
instead of having a separate member for them. This avoids duplicating
the output generation logic for the entry.
Diffstat (limited to 'Source/cmVisualStudioGeneratorOptions.cxx')
-rw-r--r-- | Source/cmVisualStudioGeneratorOptions.cxx | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index f8de3f8..dfe5ce6 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -245,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) @@ -343,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; - } - } -} |