diff options
author | Brad King <brad.king@kitware.com> | 2013-03-26 18:36:07 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-03-26 18:36:07 (GMT) |
commit | 0261bdfc1d041d949f96c4ebdd83f139d7338d71 (patch) | |
tree | f0d94a5a4ead121a020ca39195acaed09962c0c7 /Source/cmTarget.cxx | |
parent | 2fcb06039daa4492c05fa346465028ea0b3d4eff (diff) | |
parent | 1703b00c7fc34f473e84f4ba29bdc73476637005 (diff) | |
download | CMake-0261bdfc1d041d949f96c4ebdd83f139d7338d71.zip CMake-0261bdfc1d041d949f96c4ebdd83f139d7338d71.tar.gz CMake-0261bdfc1d041d949f96c4ebdd83f139d7338d71.tar.bz2 |
Merge topic 'fix-COMPILE_DEFINITIONS-config'
1703b00 Test evaluation of per-config COMPILE_DEFINITIONS (#14037)
a6286e9 Fix the evaluation of per-config COMPILE_DEFINITIONS (#14037)
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 61d4ce2..53e3cfa 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2942,29 +2942,33 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config) //---------------------------------------------------------------------------- std::string cmTarget::GetCompileDefinitions(const char *config) { - std::string defPropName = "COMPILE_DEFINITIONS"; + const char *configProp = 0; if (config) { - defPropName += "_" + cmSystemTools::UpperCase(config); + std::string configPropName; + configPropName = "COMPILE_DEFINITIONS_" + cmSystemTools::UpperCase(config); + configProp = this->GetProperty(configPropName.c_str()); } - const char *prop = this->GetProperty(defPropName.c_str()); + const char *noconfigProp = this->GetProperty("COMPILE_DEFINITIONS"); cmListFileBacktrace lfbt; cmGeneratorExpressionDAGChecker dagChecker(lfbt, this->GetName(), - defPropName, 0, 0); + "COMPILE_DEFINITIONS", 0, 0); - std::string result; - if (prop) + std::string defsString = (noconfigProp ? noconfigProp : ""); + if (configProp && noconfigProp) { - cmGeneratorExpression ge(lfbt); - - result = ge.Parse(prop)->Evaluate(this->Makefile, - config, - false, - this, - &dagChecker); + defsString += ";"; } + defsString += (configProp ? configProp : ""); + + cmGeneratorExpression ge(lfbt); + std::string result = ge.Parse(defsString.c_str())->Evaluate(this->Makefile, + config, + false, + this, + &dagChecker); std::vector<std::string> libs; this->GetDirectLinkLibraries(config, libs, this); |