summaryrefslogtreecommitdiffstats
path: root/Source/cmExtraSublimeTextGenerator.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@sap.com>2017-12-13 15:34:11 (GMT)
committerMarc Chevrier <marc.chevrier@sap.com>2017-12-13 15:35:22 (GMT)
commit10f58b27ac1015e4f1615372bb5168e43afcdf3a (patch)
tree8f1db98fd525f9a4039fd9a0194b009d208a4acc /Source/cmExtraSublimeTextGenerator.cxx
parent14fe6d431b12139ea2aeb5bcc09efd0f964597aa (diff)
downloadCMake-10f58b27ac1015e4f1615372bb5168e43afcdf3a.zip
CMake-10f58b27ac1015e4f1615372bb5168e43afcdf3a.tar.gz
CMake-10f58b27ac1015e4f1615372bb5168e43afcdf3a.tar.bz2
Genex: Per-source $<COMPILE_LANGUAGE:...> support
Fixes: #17542
Diffstat (limited to 'Source/cmExtraSublimeTextGenerator.cxx')
-rw-r--r--Source/cmExtraSublimeTextGenerator.cxx20
1 files changed, 13 insertions, 7 deletions
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index bd1b6bb..c7197f2 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -361,9 +361,11 @@ std::string cmExtraSublimeTextGenerator::ComputeFlagsForObject(
}
// Add source file specific flags.
- if (const char* cflags = source->GetProperty("COMPILE_FLAGS")) {
- cmGeneratorExpressionInterpreter genexInterpreter(lg, gtgt, config);
- lg->AppendFlags(flags, genexInterpreter.Evaluate(cflags));
+ const std::string COMPILE_FLAGS("COMPILE_FLAGS");
+ if (const char* cflags = source->GetProperty(COMPILE_FLAGS)) {
+ cmGeneratorExpressionInterpreter genexInterpreter(
+ lg, gtgt, config, gtgt->GetName(), language);
+ lg->AppendFlags(flags, genexInterpreter.Evaluate(cflags, COMPILE_FLAGS));
}
return flags;
@@ -379,7 +381,8 @@ std::string cmExtraSublimeTextGenerator::ComputeDefines(
cmMakefile* makefile = lg->GetMakefile();
const std::string& language = source->GetLanguage();
const std::string& config = makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
- cmGeneratorExpressionInterpreter genexInterpreter(lg, target, config);
+ cmGeneratorExpressionInterpreter genexInterpreter(
+ lg, target, config, target->GetName(), language);
// Add the export symbol definition for shared library objects.
if (const char* exportMacro = target->GetExportMacro()) {
@@ -388,14 +391,17 @@ std::string cmExtraSublimeTextGenerator::ComputeDefines(
// Add preprocessor definitions for this target and configuration.
lg->AddCompileDefinitions(defines, target, config, language);
- if (const char* compile_defs = source->GetProperty("COMPILE_DEFINITIONS")) {
- lg->AppendDefines(defines, genexInterpreter.Evaluate(compile_defs));
+ const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS");
+ if (const char* compile_defs = source->GetProperty(COMPILE_DEFINITIONS)) {
+ lg->AppendDefines(
+ defines, genexInterpreter.Evaluate(compile_defs, COMPILE_DEFINITIONS));
}
std::string defPropName = "COMPILE_DEFINITIONS_";
defPropName += cmSystemTools::UpperCase(config);
if (const char* config_compile_defs = source->GetProperty(defPropName)) {
- lg->AppendDefines(defines, genexInterpreter.Evaluate(config_compile_defs));
+ lg->AppendDefines(defines, genexInterpreter.Evaluate(config_compile_defs,
+ COMPILE_DEFINITIONS));
}
std::string definesString;