| 458 | }; |
| 459 | |
| 460 | MetaDataProperties 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 | |
| 505 | void PopulateFileSet(cmTarget& target, MetaDataProperties const& props) |
| 506 | { |
no test coverage detected
searching dependent graphs…