| 1424 | } |
| 1425 | |
| 1426 | void Target::ProcessLanguage(std::string const& lang) |
| 1427 | { |
| 1428 | CompileData& cd = this->CompileDataMap[lang]; |
| 1429 | cd.Language = lang; |
| 1430 | if (cmValue sysrootCompile = |
| 1431 | this->GT->Makefile->GetDefinition("CMAKE_SYSROOT_COMPILE")) { |
| 1432 | cd.Sysroot = *sysrootCompile; |
| 1433 | } else if (cmValue sysroot = |
| 1434 | this->GT->Makefile->GetDefinition("CMAKE_SYSROOT")) { |
| 1435 | cd.Sysroot = *sysroot; |
| 1436 | } |
| 1437 | cmLocalGenerator* lg = this->GT->GetLocalGenerator(); |
| 1438 | { |
| 1439 | // FIXME: Add flags from end section of ExpandRuleVariable, |
| 1440 | // which may need to be factored out. |
| 1441 | std::vector<BT<std::string>> flags = |
| 1442 | lg->GetTargetCompileFlags(this->GT, this->Config, lang); |
| 1443 | |
| 1444 | cd.Flags.reserve(flags.size()); |
| 1445 | for (const BT<std::string>& f : flags) { |
| 1446 | cd.Flags.emplace_back(this->ToJBT(f)); |
| 1447 | } |
| 1448 | } |
| 1449 | std::set<BT<std::string>> defines = |
| 1450 | lg->GetTargetDefines(this->GT, this->Config, lang); |
| 1451 | cd.Defines.reserve(defines.size()); |
| 1452 | for (BT<std::string> const& d : defines) { |
| 1453 | cd.Defines.emplace_back(this->ToJBT(d)); |
| 1454 | } |
| 1455 | std::vector<BT<std::string>> includePathList = |
| 1456 | lg->GetIncludeDirectories(this->GT, lang, this->Config); |
| 1457 | for (BT<std::string> const& i : includePathList) { |
| 1458 | if (this->GT->IsApple() && cmSystemTools::IsPathToFramework(i.Value)) { |
| 1459 | cd.Frameworks.emplace_back( |
| 1460 | this->ToJBT(i), |
| 1461 | this->GT->IsSystemIncludeDirectory(i.Value, this->Config, lang)); |
| 1462 | } else { |
| 1463 | cd.Includes.emplace_back( |
| 1464 | this->ToJBT(i), |
| 1465 | this->GT->IsSystemIncludeDirectory(i.Value, this->Config, lang)); |
| 1466 | } |
| 1467 | } |
| 1468 | std::vector<BT<std::string>> precompileHeaders = |
| 1469 | this->GT->GetPrecompileHeaders(this->Config, lang); |
| 1470 | for (BT<std::string> const& pch : precompileHeaders) { |
| 1471 | cd.PrecompileHeaders.emplace_back(this->ToJBT(pch)); |
| 1472 | } |
| 1473 | BTs<std::string> const* languageStandard = |
| 1474 | this->GT->GetLanguageStandardProperty(lang, this->Config); |
| 1475 | if (languageStandard) { |
| 1476 | cd.LanguageStandard = this->ToJBTs(*languageStandard); |
| 1477 | } |
| 1478 | } |
| 1479 | |
| 1480 | Json::ArrayIndex Target::AddSourceGroup(cmSourceGroup const* sg) |
| 1481 | { |
no test coverage detected