diff options
author | Marc Chevrier <marc.chevrier@sap.com> | 2017-12-01 16:10:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-12-04 14:10:09 (GMT) |
commit | 6bffc13ef1c85ec565273d25e811fd6c326533f0 (patch) | |
tree | 752484518da79d7edfe4ba98880f1ce7d694478c /Source/cmMakefileTargetGenerator.cxx | |
parent | a4faf8638744edf7e3dd8931b55ba87e8f7738be (diff) | |
download | CMake-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/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index dd8a373..85dc55e 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -425,6 +425,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( std::string config = this->LocalGenerator->GetConfigName(); std::string configUpper = cmSystemTools::UpperCase(config); + cmGeneratorExpressionInterpreter genexInterpreter( + this->LocalGenerator, this->GeneratorTarget, config); // Add Fortran format flags. if (lang == "Fortran") { @@ -433,10 +435,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( // Add flags from source file properties. if (const char* cflags = source.GetProperty("COMPILE_FLAGS")) { - cmGeneratorExpression ge; - std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(cflags); - const char* evaluatedFlags = cge->Evaluate(this->LocalGenerator, config, - false, this->GeneratorTarget); + const char* evaluatedFlags = genexInterpreter.Evaluate(cflags); this->LocalGenerator->AppendFlags(flags, evaluatedFlags); *this->FlagFileStream << "# Custom flags: " << relativeObj << "_FLAGS = " << evaluatedFlags << "\n" |