MCPcopy Create free account
hub / github.com/Kitware/CMake / ProcessLanguage

Method ProcessLanguage

Source/cmFileAPICodemodel.cxx:1426–1478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1424}
1425
1426void 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
1480Json::ArrayIndex Target::AddSourceGroup(cmSourceGroup const* sg)
1481{

Callers 1

ProcessLanguagesMethod · 0.95

Calls 14

ToJBTMethod · 0.95
ToJBTsMethod · 0.95
GetTargetCompileFlagsMethod · 0.80
reserveMethod · 0.80
emplace_backMethod · 0.80
GetTargetDefinesMethod · 0.80
GetPrecompileHeadersMethod · 0.80
GetDefinitionMethod · 0.45
GetLocalGeneratorMethod · 0.45
sizeMethod · 0.45
GetIncludeDirectoriesMethod · 0.45

Tested by

no test coverage detected