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

Function CollectMetaProperties

Source/cmCxxModuleMetadata.cxx:460–503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

458};
459
460MetaDataProperties CollectMetaProperties(cmCxxModuleMetadata const& meta)
461{
462 MetaDataProperties props;
463
464 props.MetadataDir = cmSystemTools::GetFilenamePath(meta.MetadataFilePath);
465
466 for (auto const& module : meta.Modules) {
467 std::string sourcePath = props.NormalizePath(module.SourcePath);
468 props.Sources.insert(sourcePath);
469
470 // Module metadata files can reference files in different roots,
471 // just use the immediate parent directory as a base directory
472 props.BaseDirs.insert(cmSystemTools::GetFilenamePath(sourcePath));
473
474 if (module.LocalArguments) {
475 for (auto const& incDir : module.LocalArguments->IncludeDirectories) {
476 props.AllIncludeDirectories.emplace(props.NormalizePath(incDir));
477 }
478 for (auto const& sysIncDir :
479 module.LocalArguments->SystemIncludeDirectories) {
480 props.AllIncludeDirectories.emplace(props.NormalizePath(sysIncDir));
481 }
482 for (auto const& opt : module.LocalArguments->CompileOptions) {
483 props.AllCompileOptions.emplace(opt);
484 }
485 for (auto const& opt : module.LocalArguments->CompileFeatures) {
486 props.AllCompileFeatures.emplace(opt);
487 }
488
489 for (auto const& def : module.LocalArguments->Definitions) {
490 if (!def.Undef) {
491 if (def.Value) {
492 props.AllCompileDefinitions.emplace(
493 cmStrCat(def.Name, "="_s, *def.Value));
494 } else {
495 props.AllCompileDefinitions.emplace(def.Name);
496 }
497 }
498 }
499 }
500 }
501
502 return props;
503}
504
505void PopulateFileSet(cmTarget& target, MetaDataProperties const& props)
506{

Callers 1

PopulateTargetMethod · 0.85

Calls 4

emplaceMethod · 0.80
cmStrCatFunction · 0.70
NormalizePathMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…