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

Method DumpTarget

Source/cmFileAPICodemodel.cxx:745–780  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

743}
744
745Json::Value CodemodelConfig::DumpTarget(cmGeneratorTarget* gt,
746 Json::ArrayIndex ti)
747{
748 Target t(gt, this->VersionMajor, this->VersionMinor, this->Config);
749 std::string safeTargetName = gt->GetName();
750 std::replace(safeTargetName.begin(), safeTargetName.end(), ':', '_');
751 std::string prefix = "target-" + safeTargetName;
752 if (!this->Config.empty()) {
753 prefix += "-" + this->Config;
754 }
755 Json::Value target = this->FileAPI.MaybeJsonFile(t.Dump(), prefix);
756 target["name"] = gt->GetName();
757 target["id"] = TargetId(gt, this->TopBuild);
758
759 // Cross-reference directory containing target.
760 Json::ArrayIndex di = this->GetDirectoryIndex(gt->GetLocalGenerator());
761 target["directoryIndex"] = di;
762 if (gt->IsInBuildSystem()) {
763 this->Directories[di].BuildSystemTargetIndexes.append(ti);
764 } else {
765 this->Directories[di].AbstractTargetIndexes.append(ti);
766 }
767
768 // Cross-reference project containing target.
769 Json::ArrayIndex pi = this->Directories[di].ProjectIndex;
770 target["projectIndex"] = pi;
771 if (gt->IsInBuildSystem()) {
772 this->Projects[pi].BuildSystemTargetIndexes.append(ti);
773 } else {
774 this->Projects[pi].AbstractTargetIndexes.append(ti);
775 }
776
777 this->TargetIndexMap[gt] = ti;
778
779 return target;
780}
781
782Json::Value CodemodelConfig::DumpDirectories()
783{

Callers 1

DumpTargetsMethod · 0.95

Calls 11

GetDirectoryIndexMethod · 0.95
TargetIdFunction · 0.85
MaybeJsonFileMethod · 0.80
IsInBuildSystemMethod · 0.80
appendMethod · 0.80
GetNameMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
DumpMethod · 0.45
GetLocalGeneratorMethod · 0.45

Tested by

no test coverage detected