[Cmake-commits] CMake branch, next, updated. v3.8.0-rc1-188-g2556769
Brad King
brad.king at kitware.com
Wed Feb 15 15:03:43 EST 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 2556769b73a707529a73df5a474620281e3fb7d8 (commit)
via 109b8a6fd32be9886de71f98170e0c512ac9883f (commit)
via bd5ea6993c8376cd3612100019e15ee256a758d8 (commit)
via 3936a2886efc1fd46560352f3a48d6a656f95367 (commit)
from dd0648f5baa4a6ddf640191fb9c82fc300c3732b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2556769b73a707529a73df5a474620281e3fb7d8
commit 2556769b73a707529a73df5a474620281e3fb7d8
Merge: dd0648f 109b8a6
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Feb 15 15:03:42 2017 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Feb 15 15:03:42 2017 -0500
Merge topic 'vs-refactor-unknown-flags' into next
109b8a6f VS: Refactor AdditionalOptions generation
bd5ea699 cmVisualStudioGeneratorOptions: Add PrependInerhitedString method
3936a288 cmIDEOptions: Add SpaceAppendable flag table type
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=109b8a6fd32be9886de71f98170e0c512ac9883f
commit 109b8a6fd32be9886de71f98170e0c512ac9883f
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Feb 15 10:40:00 2017 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Feb 15 10:41:36 2017 -0500
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.
diff --git a/Source/cmIDEOptions.h b/Source/cmIDEOptions.h
index aaa9d3d..465cf2c 100644
--- a/Source/cmIDEOptions.h
+++ b/Source/cmIDEOptions.h
@@ -74,9 +74,6 @@ protected:
// Preprocessor definitions.
std::vector<std::string> Defines;
- // Unrecognized flags that get no special handling.
- std::string FlagString;
-
bool DoingDefine;
bool AllowDefine;
bool AllowSlash;
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 38dda04..6e976e1 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -787,7 +787,6 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
<< this->ConvertToXMLOutputPath(modDir.c_str())
<< "\\$(ConfigurationName)\"\n";
}
- targetOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n");
fout << "\t\t\t\tAdditionalIncludeDirectories=\"";
std::vector<std::string> includes;
this->GetIncludeDirectories(includes, target, "C", configName);
@@ -1090,7 +1089,6 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(
if (!gg->NeedLinkLibraryDependencies(target)) {
fout << "\t\t\t\tLinkLibraryDependencies=\"false\"\n";
}
- linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n");
// Use the NOINHERIT macro to avoid getting VS project default
// libraries which may be set by the user to something bad.
fout << "\t\t\t\tAdditionalDependencies=\"$(NOINHERIT) "
@@ -1176,7 +1174,6 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(
if (!gg->NeedLinkLibraryDependencies(target)) {
fout << "\t\t\t\tLinkLibraryDependencies=\"false\"\n";
}
- linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n");
// Use the NOINHERIT macro to avoid getting VS project default
// libraries which may be set by the user to something bad.
fout << "\t\t\t\tAdditionalDependencies=\"$(NOINHERIT) "
@@ -1675,7 +1672,6 @@ bool cmLocalVisualStudio7Generator::WriteGroup(
fileOptions.Parse(fc.CompileFlags.c_str());
fileOptions.AddDefines(fc.CompileDefs.c_str());
fileOptions.AddDefines(fc.CompileDefsConfig.c_str());
- fileOptions.OutputAdditionalOptions(fout, "\t\t\t\t\t", "\n");
fileOptions.OutputFlagMap(fout, "\t\t\t\t\t");
fileOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t\t", "\n",
ppLang);
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index f084e19..e3853ed 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1939,7 +1939,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
}
clOptions.AddDefines(configDefines.c_str());
clOptions.SetConfiguration((*config).c_str());
- clOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", "");
+ clOptions.PrependInheritedString("AdditionalOptions");
clOptions.OutputFlagMap(*this->BuildFileStream, " ");
clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ",
"\n", lang);
@@ -2293,7 +2293,7 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
return;
}
this->WriteString("<ClCompile>\n", 2);
- clOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", "");
+ clOptions.PrependInheritedString("AdditionalOptions");
clOptions.AppendFlag("AdditionalIncludeDirectories", includes);
clOptions.AppendFlag("AdditionalIncludeDirectories",
"%(AdditionalIncludeDirectories)");
@@ -2395,8 +2395,8 @@ void cmVisualStudio10TargetGenerator::WriteRCOptions(
rcOptions.AppendFlag("AdditionalIncludeDirectories", includes);
rcOptions.AppendFlag("AdditionalIncludeDirectories",
"%(AdditionalIncludeDirectories)");
+ rcOptions.PrependInheritedString("AdditionalOptions");
rcOptions.OutputFlagMap(*this->BuildFileStream, " ");
- rcOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", "");
this->WriteString("</ResourceCompile>\n", 2);
}
@@ -2453,8 +2453,8 @@ void cmVisualStudio10TargetGenerator::WriteMasmOptions(
Options& masmOptions = *(this->MasmOptions[configName]);
masmOptions.AppendFlag("IncludePaths", includes);
masmOptions.AppendFlag("IncludePaths", "%(IncludePaths)");
+ masmOptions.PrependInheritedString("AdditionalOptions");
masmOptions.OutputFlagMap(*this->BuildFileStream, " ");
- masmOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", "");
this->WriteString("</MASM>\n", 2);
}
@@ -2512,7 +2512,7 @@ void cmVisualStudio10TargetGenerator::WriteNasmOptions(
nasmOptions.AppendFlag("IncludePaths", includes);
nasmOptions.AppendFlag("IncludePaths", "%(IncludePaths)");
nasmOptions.OutputFlagMap(*this->BuildFileStream, " ");
- nasmOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", "");
+ nasmOptions.PrependInheritedString("AdditionalOptions");
nasmOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ",
"\n", "ASM_NASM");
@@ -2542,7 +2542,7 @@ void cmVisualStudio10TargetGenerator::WriteLibOptions(
this->LocalGenerator, cmVisualStudioGeneratorOptions::Linker,
gg->GetLibFlagTable(), 0, this);
libOptions.Parse(libflags.c_str());
- libOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", "");
+ libOptions.PrependInheritedString("AdditionalOptions");
libOptions.OutputFlagMap(*this->BuildFileStream, " ");
this->WriteString("</Lib>\n", 2);
}
@@ -3019,7 +3019,7 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(
Options& linkOptions = *(this->LinkOptions[config]);
this->WriteString("<Link>\n", 2);
- linkOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", "");
+ linkOptions.PrependInheritedString("AdditionalOptions");
linkOptions.OutputFlagMap(*this->BuildFileStream, " ");
this->WriteString("</Link>\n", 2);
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;
- }
- }
-}
diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h
index ee9d0a5..8c49470 100644
--- a/Source/cmVisualStudioGeneratorOptions.h
+++ b/Source/cmVisualStudioGeneratorOptions.h
@@ -67,8 +67,6 @@ public:
const char* suffix,
const std::string& lang);
void OutputFlagMap(std::ostream& fout, const char* indent);
- void OutputAdditionalOptions(std::ostream& fout, const char* prefix,
- const char* suffix);
void SetConfiguration(const char* config);
private:
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bd5ea6993c8376cd3612100019e15ee256a758d8
commit bd5ea6993c8376cd3612100019e15ee256a758d8
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Feb 15 10:36:56 2017 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Feb 15 10:37:35 2017 -0500
cmVisualStudioGeneratorOptions: Add PrependInerhitedString method
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index 6bacfa1..f8de3f8 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.
diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h
index 3a53ff5..ee9d0a5 100644
--- a/Source/cmVisualStudioGeneratorOptions.h
+++ b/Source/cmVisualStudioGeneratorOptions.h
@@ -47,6 +47,8 @@ public:
void Parse(const char* flags);
void ParseFinish();
+ void PrependInheritedString(std::string const& key);
+
// Fix the ExceptionHandling option to default to off.
void FixExceptionHandlingDefault();
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3936a2886efc1fd46560352f3a48d6a656f95367
commit 3936a2886efc1fd46560352f3a48d6a656f95367
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Feb 15 09:35:36 2017 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Feb 15 10:36:09 2017 -0500
cmIDEOptions: Add SpaceAppendable flag table type
diff --git a/Source/cmIDEFlagTable.h b/Source/cmIDEFlagTable.h
index 64ade76..152e293 100644
--- a/Source/cmIDEFlagTable.h
+++ b/Source/cmIDEFlagTable.h
@@ -24,6 +24,9 @@ struct cmIDEFlagTable
// IgnoreDefaultLibraryNames)
UserFollowing = (1 << 5), // expect value in following argument
CaseInsensitive = (1 << 6), // flag may be any case
+ SpaceAppendable = (1 << 7), // a flag that if specified multiple times
+ // should have its value appended to the
+ // old value with spaces
UserValueIgnored = UserValue | UserIgnored,
UserValueRequired = UserValue | UserRequired
diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx
index c6c0e05..1c0a99e 100644
--- a/Source/cmIDEOptions.cxx
+++ b/Source/cmIDEOptions.cxx
@@ -125,6 +125,8 @@ void cmIDEOptions::FlagMapUpdate(cmIDEFlagTable const* entry,
this->FlagMap[entry->IDEName] = entry->value;
} else if (entry->special & cmIDEFlagTable::SemicolonAppendable) {
this->FlagMap[entry->IDEName].push_back(new_value);
+ } else if (entry->special & cmIDEFlagTable::SpaceAppendable) {
+ this->FlagMap[entry->IDEName].append_with_space(new_value);
} else {
// Use the user-specified value.
this->FlagMap[entry->IDEName] = new_value;
@@ -172,6 +174,12 @@ void cmIDEOptions::AppendFlag(std::string const& flag,
std::copy(value.begin(), value.end(), std::back_inserter(fv));
}
+void cmIDEOptions::AppendFlagString(std::string const& flag,
+ std::string const& value)
+{
+ this->FlagMap[flag].append_with_space(value);
+}
+
void cmIDEOptions::RemoveFlag(const char* flag)
{
this->FlagMap.erase(flag);
diff --git a/Source/cmIDEOptions.h b/Source/cmIDEOptions.h
index a0696e1..aaa9d3d 100644
--- a/Source/cmIDEOptions.h
+++ b/Source/cmIDEOptions.h
@@ -29,6 +29,7 @@ public:
void AppendFlag(std::string const& flag, std::string const& value);
void AppendFlag(std::string const& flag,
std::vector<std::string> const& value);
+ void AppendFlagString(std::string const& flag, std::string const& value);
void RemoveFlag(const char* flag);
bool HasFlag(std::string const& flag) const;
const char* GetFlag(const char* flag);
@@ -57,6 +58,16 @@ protected:
this->derived::operator=(r);
return *this;
}
+ FlagValue& append_with_space(std::string const& r)
+ {
+ this->resize(1);
+ std::string& l = this->operator[](0);
+ if (!l.empty()) {
+ l += " ";
+ }
+ l += r;
+ return *this;
+ }
};
std::map<std::string, FlagValue> FlagMap;
-----------------------------------------------------------------------
Summary of changes:
Source/cmIDEFlagTable.h | 3 +++
Source/cmIDEOptions.cxx | 8 ++++++
Source/cmIDEOptions.h | 14 +++++++---
Source/cmLocalVisualStudio7Generator.cxx | 4 ---
Source/cmVisualStudio10TargetGenerator.cxx | 14 +++++-----
Source/cmVisualStudioGeneratorOptions.cxx | 38 ++++++++++------------------
Source/cmVisualStudioGeneratorOptions.h | 4 +--
7 files changed, 44 insertions(+), 41 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list