| 685 | } |
| 686 | |
| 687 | Json::ArrayIndex CodemodelConfig::AddProject(cmStateSnapshot s) |
| 688 | { |
| 689 | cmStateSnapshot ps = s.GetBuildsystemDirectoryParent(); |
| 690 | if (ps.IsValid() && ps.GetProjectName() == s.GetProjectName()) { |
| 691 | // This directory is part of its parent directory project. |
| 692 | Json::ArrayIndex const parentDirIndex = this->GetDirectoryIndex(ps); |
| 693 | return this->Directories[parentDirIndex].ProjectIndex; |
| 694 | } |
| 695 | |
| 696 | // This directory starts a new project. |
| 697 | auto projectIndex = static_cast<Json::ArrayIndex>(this->Projects.size()); |
| 698 | this->Projects.emplace_back(); |
| 699 | Project& p = this->Projects[projectIndex]; |
| 700 | p.Snapshot = s; |
| 701 | this->ProjectMap[s] = projectIndex; |
| 702 | if (ps.IsValid()) { |
| 703 | Json::ArrayIndex const parentDirIndex = this->GetDirectoryIndex(ps); |
| 704 | p.ParentIndex = this->Directories[parentDirIndex].ProjectIndex; |
| 705 | this->Projects[p.ParentIndex].ChildIndexes.append(projectIndex); |
| 706 | } |
| 707 | return projectIndex; |
| 708 | } |
| 709 | |
| 710 | CodemodelConfig::DumpedTargets CodemodelConfig::DumpTargets() |
| 711 | { |
no test coverage detected