diff options
author | Marc Chevrier <marc.chevrier@sap.com> | 2017-12-13 15:34:11 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@sap.com> | 2017-12-13 15:35:22 (GMT) |
commit | 10f58b27ac1015e4f1615372bb5168e43afcdf3a (patch) | |
tree | 8f1db98fd525f9a4039fd9a0194b009d208a4acc /Source/cmMakefileTargetGenerator.cxx | |
parent | 14fe6d431b12139ea2aeb5bcc09efd0f964597aa (diff) | |
download | CMake-10f58b27ac1015e4f1615372bb5168e43afcdf3a.zip CMake-10f58b27ac1015e4f1615372bb5168e43afcdf3a.tar.gz CMake-10f58b27ac1015e4f1615372bb5168e43afcdf3a.tar.bz2 |
Genex: Per-source $<COMPILE_LANGUAGE:...> support
Fixes: #17542
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 5e0c582..82506d2 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -426,7 +426,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( std::string config = this->LocalGenerator->GetConfigName(); std::string configUpper = cmSystemTools::UpperCase(config); cmGeneratorExpressionInterpreter genexInterpreter( - this->LocalGenerator, this->GeneratorTarget, config); + this->LocalGenerator, this->GeneratorTarget, config, + this->GeneratorTarget->GetName(), lang); // Add Fortran format flags. if (lang == "Fortran") { @@ -434,8 +435,10 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( } // Add flags from source file properties. - if (const char* cflags = source.GetProperty("COMPILE_FLAGS")) { - const char* evaluatedFlags = genexInterpreter.Evaluate(cflags); + const std::string COMPILE_FLAGS("COMPILE_FLAGS"); + if (const char* cflags = source.GetProperty(COMPILE_FLAGS)) { + const char* evaluatedFlags = + genexInterpreter.Evaluate(cflags, COMPILE_FLAGS); this->LocalGenerator->AppendFlags(flags, evaluatedFlags); *this->FlagFileStream << "# Custom flags: " << relativeObj << "_FLAGS = " << evaluatedFlags << "\n" @@ -446,8 +449,10 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( std::set<std::string> defines; // Add source-sepcific preprocessor definitions. - if (const char* compile_defs = source.GetProperty("COMPILE_DEFINITIONS")) { - const char* evaluatedDefs = genexInterpreter.Evaluate(compile_defs); + const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS"); + if (const char* compile_defs = source.GetProperty(COMPILE_DEFINITIONS)) { + const char* evaluatedDefs = + genexInterpreter.Evaluate(compile_defs, COMPILE_DEFINITIONS); this->LocalGenerator->AppendDefines(defines, evaluatedDefs); *this->FlagFileStream << "# Custom defines: " << relativeObj << "_DEFINES = " << evaluatedDefs << "\n" @@ -456,7 +461,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( std::string defPropName = "COMPILE_DEFINITIONS_"; defPropName += configUpper; if (const char* config_compile_defs = source.GetProperty(defPropName)) { - const char* evaluatedDefs = genexInterpreter.Evaluate(config_compile_defs); + const char* evaluatedDefs = + genexInterpreter.Evaluate(config_compile_defs, COMPILE_DEFINITIONS); this->LocalGenerator->AppendDefines(defines, evaluatedDefs); *this->FlagFileStream << "# Custom defines: " << relativeObj << "_DEFINES_" << configUpper << " = " << evaluatedDefs << "\n" |