| 270 | } |
| 271 | |
| 272 | void 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 | |
| 311 | void cmGraphVizWriter::FindAllConnections(ConnectionsMap const& connectionMap, |
| 312 | cmLinkItem const& rootItem, |
nothing calls this directly
no test coverage detected