@@ -411,15 +411,26 @@ export int consumer_flag_v() {
411411 for (std::string m : {" pa" , " pb" , " pc" })
412412 expect (fatal (span (m).has_value ())) << part << " : the build programs' .ninja_log does not record the compile of " << m;
413413 };
414- // The steps of each member's build program -- its scan, compile and link (`obj/<m>-...`,
415- // `bin/<m>-...`) -- and the most members with a step under way at one instant.
414+ // The steps of each member's build program -- its scan, compile, resource and link
415+ // (`obj/<m>-...`, `res/<m>-...`, `bin/<m>-...`) -- and the most members with a step under
416+ // way at one instant. A step is an edge: the log's rows of one command share its hash and
417+ // times (an edge writes several files), and an edge is a member's when every file it
418+ // writes is that member's. The edge that deploys the C++ runtime's DLLs beside each
419+ // member's program on Windows writes into all three, and is no member's step.
416420 const auto steps = [&](std::string_view part) {
417- std::vector<std::pair<std::string, std::pair<long , long >>> out;
418421 const auto logs = s::find_files (ws.at (" target/.build-mcpp/host" ), R"( \.ninja_log)" );
419422 expect (fatal (!logs.empty ())) << part << " : the build programs' graph left no .ninja_log" ;
420- const std::regex re{R"( ^(obj|bin)/(p[abc])-[0-9a-f]+/)" };
421- for (const auto & row : ninja_rows (logs.front ()))
422- if (std::smatch m; std::regex_search (row[3 ], m, re)) out.push_back ({m[2 ].str (), {std::stol (row[0 ]), std::stol (row[1 ])}});
423+ const std::regex re{R"( ^(obj|res|bin)/(p[abc])-[0-9a-f]+/)" };
424+ std::map<std::string, std::pair<std::set<std::string>, std::pair<long , long >>> edges;
425+ for (const auto & row : ninja_rows (logs.front ())) {
426+ auto & edge = edges[(row.size () > 4 ? row[4 ] : row[3 ]) + " @" + row[0 ] + " -" + row[1 ]];
427+ edge.second = {std::stol (row[0 ]), std::stol (row[1 ])};
428+ std::smatch m;
429+ edge.first .insert (std::regex_search (row[3 ], m, re) ? m[2 ].str () : std::string{" -" });
430+ }
431+ std::vector<std::pair<std::string, std::pair<long , long >>> out;
432+ for (const auto & [_, edge] : edges)
433+ if (edge.first .size () == 1 && *edge.first .begin () != " -" ) out.push_back ({*edge.first .begin (), edge.second });
423434 return out;
424435 };
425436 const auto members_at_once = [](const std::vector<std::pair<std::string, std::pair<long , long >>>& all) {
0 commit comments