From d53358c350898091d9cf2ba76ccdfa9e590275ee Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 26 Feb 2025 10:16:30 +0100 Subject: Make graph-dumping options cummulative If --dump-graph or --dump-plain-graph is given several times, the action graph wil also be written several times. In this way, regular use of those options will not be affected by adding them implicitly through invocation-logging options in the rc file. --- src/buildtool/main/main.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/buildtool/main/main.cpp') diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp index e4ac6a02..b8579b55 100644 --- a/src/buildtool/main/main.cpp +++ b/src/buildtool/main/main.cpp @@ -1150,14 +1150,10 @@ auto main(int argc, char* argv[]) -> int { not_eligible); } - if (arguments.analysis.graph_file) { - analyse_result->result_map.ToFile( - *arguments.analysis.graph_file, &stats, &progress); - } - if (arguments.analysis.graph_file_plain) { - analyse_result->result_map.ToFile( - *arguments.analysis.graph_file_plain, &stats, &progress); - } + analyse_result->result_map.ToFile( + arguments.analysis.graph_file, &stats, &progress); + analyse_result->result_map.ToFile( + arguments.analysis.graph_file_plain, &stats, &progress); auto const [artifacts, runfiles] = ReadOutputArtifacts(analyse_result->target); if (arguments.analysis.artifacts_to_build_file) { -- cgit v1.2.3