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

Method Write

Source/cmGraphVizWriter.cxx:272–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270}
271
272void cmGraphVizWriter::Write()
273{
274 auto const* gg = this->GlobalGenerator;
275
276 this->VisitGraph(gg->GetName());
277
278 // We want to traverse in a determined order, such that the output is always
279 // the same for a given project (this makes tests reproducible, etc.)
280 std::set<cmGeneratorTarget const*, cmGeneratorTarget::StrictTargetComparison>
281 sortedGeneratorTargets;
282
283 for (auto const& lg : gg->GetLocalGenerators()) {
284 for (auto const& gt : lg->GetGeneratorTargets()) {
285 // Reserved targets have inconsistent names across platforms (e.g. 'all'
286 // vs. 'ALL_BUILD'), which can disrupt the traversal ordering.
287 // We don't need or want them anyway.
288 if (!cmGlobalGenerator::IsReservedTarget(gt->GetName()) &&
289 !cmHasLiteralPrefix(gt->GetName(), "__cmake_")) {
290 sortedGeneratorTargets.insert(gt.get());
291 }
292 }
293 }
294
295 // write global data and collect all connection data for per target graphs
296 for (auto const* const gt : sortedGeneratorTargets) {
297 auto item = cmLinkItem(gt, false, gt->GetBacktrace());
298 this->VisitItem(item);
299 }
300
301 if (this->GeneratePerTarget) {
302 this->WritePerTargetConnections<DependeesDir>(this->PerTargetConnections);
303 }
304
305 if (this->GenerateDependers) {
306 this->WritePerTargetConnections<DependersDir>(
307 this->TargetDependersConnections, ".dependers");
308 }
309}
310
311void cmGraphVizWriter::FindAllConnections(ConnectionsMap const& connectionMap,
312 cmLinkItem const& rootItem,

Callers

nothing calls this directly

Calls 8

VisitGraphMethod · 0.95
cmHasLiteralPrefixFunction · 0.85
VisitItemMethod · 0.80
cmLinkItemClass · 0.70
GetNameMethod · 0.45
insertMethod · 0.45
getMethod · 0.45
GetBacktraceMethod · 0.45

Tested by

no test coverage detected