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