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/cmServerProtocol.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/cmServerProtocol.cxx')
-rw-r--r-- | Source/cmServerProtocol.cxx | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index ad66467..d745c49 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -691,8 +691,6 @@ static Json::Value DumpSourceFilesList( std::vector<cmSourceFile*> files; target->GetSourceFiles(files, config); - cmGeneratorExpressionInterpreter genexInterpreter( - target->GetLocalGenerator(), target, config); std::unordered_map<LanguageData, std::vector<std::string>> fileGroups; for (cmSourceFile* file : files) { @@ -701,24 +699,31 @@ static Json::Value DumpSourceFilesList( if (!fileData.Language.empty()) { const LanguageData& ld = languageDataMap.at(fileData.Language); cmLocalGenerator* lg = target->GetLocalGenerator(); + cmGeneratorExpressionInterpreter genexInterpreter( + lg, target, config, target->GetName(), fileData.Language); std::string compileFlags = ld.Flags; - if (const char* cflags = file->GetProperty("COMPILE_FLAGS")) { - lg->AppendFlags(compileFlags, genexInterpreter.Evaluate(cflags)); + const std::string COMPILE_FLAGS("COMPILE_FLAGS"); + if (const char* cflags = file->GetProperty(COMPILE_FLAGS)) { + lg->AppendFlags(compileFlags, + genexInterpreter.Evaluate(cflags, COMPILE_FLAGS)); } fileData.Flags = compileFlags; fileData.IncludePathList = ld.IncludePathList; + const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS"); std::set<std::string> defines; - if (const char* defs = file->GetProperty("COMPILE_DEFINITIONS")) { - lg->AppendDefines(defines, genexInterpreter.Evaluate(defs)); + if (const char* defs = file->GetProperty(COMPILE_DEFINITIONS)) { + lg->AppendDefines( + defines, genexInterpreter.Evaluate(defs, COMPILE_DEFINITIONS)); } const std::string defPropName = "COMPILE_DEFINITIONS_" + cmSystemTools::UpperCase(config); if (const char* config_defs = file->GetProperty(defPropName)) { - lg->AppendDefines(defines, genexInterpreter.Evaluate(config_defs)); + lg->AppendDefines(defines, genexInterpreter.Evaluate( + config_defs, COMPILE_DEFINITIONS)); } defines.insert(ld.Defines.begin(), ld.Defines.end()); |