mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-08 23:00:07 -06:00
cmFileAPICodemodel: Build map from each target to its index
This commit is contained in:
@@ -46,6 +46,9 @@
|
||||
|
||||
namespace {
|
||||
|
||||
using TargetIndexMapType =
|
||||
std::unordered_map<cmGeneratorTarget const*, Json::ArrayIndex>;
|
||||
|
||||
class Codemodel
|
||||
{
|
||||
cmFileAPI& FileAPI;
|
||||
@@ -94,6 +97,8 @@ class CodemodelConfig
|
||||
ProjectMap;
|
||||
std::vector<Project> Projects;
|
||||
|
||||
TargetIndexMapType TargetIndexMap;
|
||||
|
||||
void ProcessDirectories();
|
||||
|
||||
Json::ArrayIndex GetDirectoryIndex(cmLocalGenerator const* lg);
|
||||
@@ -663,6 +668,8 @@ Json::Value CodemodelConfig::DumpTarget(cmGeneratorTarget* gt,
|
||||
target["projectIndex"] = pi;
|
||||
this->Projects[pi].TargetIndexes.append(ti);
|
||||
|
||||
this->TargetIndexMap[gt] = ti;
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user