TODO: Refactor with void cmMakefileTargetGenerator::WriteTargetLanguageFlags().
| 304 | // TODO: Refactor with |
| 305 | // void cmMakefileTargetGenerator::WriteTargetLanguageFlags(). |
| 306 | std::string cmNinjaTargetGenerator::ComputeDefines(cmSourceFile const* source, |
| 307 | std::string const& language, |
| 308 | std::string const& config) |
| 309 | { |
| 310 | std::set<std::string> defines; |
| 311 | cmGeneratorExpressionInterpreter genexInterpreter( |
| 312 | this->LocalGenerator, config, this->GeneratorTarget, language); |
| 313 | |
| 314 | // Seriously?? |
| 315 | if (this->GetGlobalGenerator()->IsMultiConfig()) { |
| 316 | defines.insert(cmStrCat("CMAKE_INTDIR=\"", config, '"')); |
| 317 | } |
| 318 | |
| 319 | std::string const COMPILE_DEFINITIONS("COMPILE_DEFINITIONS"); |
| 320 | if (cmValue compile_defs = source->GetProperty(COMPILE_DEFINITIONS)) { |
| 321 | this->LocalGenerator->AppendDefines( |
| 322 | defines, genexInterpreter.Evaluate(*compile_defs, COMPILE_DEFINITIONS)); |
| 323 | } |
| 324 | |
| 325 | std::string defPropName = |
| 326 | cmStrCat("COMPILE_DEFINITIONS_", cmSystemTools::UpperCase(config)); |
| 327 | if (cmValue config_compile_defs = source->GetProperty(defPropName)) { |
| 328 | this->LocalGenerator->AppendDefines( |
| 329 | defines, |
| 330 | genexInterpreter.Evaluate(*config_compile_defs, COMPILE_DEFINITIONS)); |
| 331 | } |
| 332 | |
| 333 | std::string definesString = this->GetDefines(language, config); |
| 334 | this->LocalGenerator->JoinDefines(defines, definesString, language); |
| 335 | |
| 336 | return definesString; |
| 337 | } |
| 338 | |
| 339 | std::string cmNinjaTargetGenerator::ComputeIncludes( |
| 340 | cmSourceFile const* source, std::string const& language, |
no test coverage detected