From 415ead81533ead72fca8a495c3cbc17e2bf4e400 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 11 Jan 2021 10:19:38 -0500 Subject: cmFileAPICodemodel: Build map from each target to its index --- Source/cmFileAPICodemodel.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx index 9061109..596edd1 100644 --- a/Source/cmFileAPICodemodel.cxx +++ b/Source/cmFileAPICodemodel.cxx @@ -46,6 +46,9 @@ namespace { +using TargetIndexMapType = + std::unordered_map; + class Codemodel { cmFileAPI& FileAPI; @@ -94,6 +97,8 @@ class CodemodelConfig ProjectMap; std::vector 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; } -- cgit v0.12