summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-12-14 13:21:40 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-12-14 13:21:52 (GMT)
commit4bc5c08476f28a23f42b4566a760b21cef60c4b3 (patch)
treeca54921299126c296412653baecd100008bc9871 /Source/cmMakefileTargetGenerator.cxx
parent7341930ade835ce48641b5415cdd3f738772edf2 (diff)
parent10f58b27ac1015e4f1615372bb5168e43afcdf3a (diff)
downloadCMake-4bc5c08476f28a23f42b4566a760b21cef60c4b3.zip
CMake-4bc5c08476f28a23f42b4566a760b21cef60c4b3.tar.gz
CMake-4bc5c08476f28a23f42b4566a760b21cef60c4b3.tar.bz2
Merge topic 'per-source-COMPILE_LANGUAGE-genex-support'
10f58b27 Genex: Per-source $<COMPILE_LANGUAGE:...> support Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1575
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx18
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"