summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@sap.com>2017-12-01 16:10:45 (GMT)
committerBrad King <brad.king@kitware.com>2017-12-04 14:10:09 (GMT)
commit6bffc13ef1c85ec565273d25e811fd6c326533f0 (patch)
tree752484518da79d7edfe4ba98880f1ce7d694478c /Source/cmNinjaTargetGenerator.cxx
parenta4faf8638744edf7e3dd8931b55ba87e8f7738be (diff)
downloadCMake-6bffc13ef1c85ec565273d25e811fd6c326533f0.zip
CMake-6bffc13ef1c85ec565273d25e811fd6c326533f0.tar.gz
CMake-6bffc13ef1c85ec565273d25e811fd6c326533f0.tar.bz2
Refactor per-source generator expression evaluation
Prepare to add generator expression support to more source properties. Factor out some duplicated code into a helper to avoid further duplication.
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 0262b3c..bad4112 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -136,12 +136,11 @@ std::string cmNinjaTargetGenerator::ComputeFlagsForObject(
// Add source file specific flags.
if (const char* cflags = source->GetProperty("COMPILE_FLAGS")) {
- std::string config = this->LocalGenerator->GetConfigName();
- cmGeneratorExpression ge;
- std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(cflags);
- const char* evaluatedFlags = cge->Evaluate(this->LocalGenerator, config,
- false, this->GeneratorTarget);
- this->LocalGenerator->AppendFlags(flags, evaluatedFlags);
+ cmGeneratorExpressionInterpreter genexInterpreter(
+ this->LocalGenerator, this->GeneratorTarget,
+ this->LocalGenerator->GetConfigName());
+ this->LocalGenerator->AppendFlags(flags,
+ genexInterpreter.Evaluate(cflags));
}
return flags;