summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-04-28 18:17:13 (GMT)
committerBrad King <brad.king@kitware.com>2017-05-01 14:33:05 (GMT)
commitb115bc49ff26da9db3e9238a98030fd94847d0d0 (patch)
tree2de3c200b335c48a9bb8d96e7fa994e7d93943d4 /Source/cmLocalGenerator.cxx
parente80e8eb609cc7dd8c4dca46b9c2819afd2293229 (diff)
downloadCMake-b115bc49ff26da9db3e9238a98030fd94847d0d0.zip
CMake-b115bc49ff26da9db3e9238a98030fd94847d0d0.tar.gz
CMake-b115bc49ff26da9db3e9238a98030fd94847d0d0.tar.bz2
Features: Refactor <LANG>_STANDARD update
In order to support generator expressions in target COMPILE_FEATURES we apply them at generate time. Move this step to the beginning of generation instead of doing it on demand while collecting flags. This avoids repeating the process unnecessarily, and will then allow `cmLocalGenerator::AddCompilerRequirementFlag` to be used any time during generation.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx33
1 files changed, 25 insertions, 8 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 33e32d1..6c8f132 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -558,6 +558,31 @@ void cmLocalGenerator::ComputeTargetManifest()
}
}
+bool cmLocalGenerator::ComputeTargetCompileFeatures()
+{
+ // Collect the set of configuration types.
+ std::vector<std::string> configNames;
+ this->Makefile->GetConfigurations(configNames);
+ if (configNames.empty()) {
+ configNames.push_back("");
+ }
+
+ // Process compile features of all targets.
+ std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::iterator t = targets.begin();
+ t != targets.end(); ++t) {
+ cmGeneratorTarget* target = *t;
+ for (std::vector<std::string>::iterator ci = configNames.begin();
+ ci != configNames.end(); ++ci) {
+ if (!target->ComputeCompileFeatures(*ci)) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
bool cmLocalGenerator::IsRootMakefile() const
{
return !this->StateSnapshot.GetBuildsystemDirectoryParent().IsValid();
@@ -742,14 +767,6 @@ void cmLocalGenerator::AddCompileOptions(std::string& flags,
this->AppendFlagEscape(flags, *i);
}
}
- std::vector<std::string> features;
- target->GetCompileFeatures(features, config);
- for (std::vector<std::string>::const_iterator it = features.begin();
- it != features.end(); ++it) {
- if (!this->Makefile->AddRequiredTargetFeature(target->Target, *it)) {
- return;
- }
- }
for (std::map<std::string, std::string>::const_iterator it =
target->GetMaxLanguageStandards().begin();