diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-11-27 14:20:10 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-11-27 14:20:10 +0200 |
commit | b71fa164192f1af8b702e1578cf202b510a9b281 (patch) | |
tree | 99e3cc0965b2fce6fe1be4151eef1e1bb44af59f /build2/b.cxx | |
parent | b48666e580abf54d426d13840f49242aa2569bb2 (diff) |
Add --dump <phase> option, omit state dumping from verbosity level 6
Diffstat (limited to 'build2/b.cxx')
-rw-r--r-- | build2/b.cxx | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/build2/b.cxx b/build2/b.cxx index 5415472..74dc7a2 100644 --- a/build2/b.cxx +++ b/build2/b.cxx @@ -23,19 +23,20 @@ #include <build2/types.hxx> #include <build2/utility.hxx> +#include <build2/dump.hxx> +#include <build2/file.hxx> +#include <build2/rule.hxx> #include <build2/spec.hxx> -#include <build2/operation.hxx> #include <build2/scope.hxx> -#include <build2/target.hxx> -#include <build2/prerequisite.hxx> -#include <build2/rule.hxx> -#include <build2/file.hxx> #include <build2/module.hxx> +#include <build2/target.hxx> +#include <build2/context.hxx> +#include <build2/variable.hxx> #include <build2/algorithm.hxx> +#include <build2/operation.hxx> #include <build2/filesystem.hxx> #include <build2/diagnostics.hxx> -#include <build2/context.hxx> -#include <build2/variable.hxx> +#include <build2/prerequisite.hxx> #include <build2/parser.hxx> @@ -537,6 +538,14 @@ main (int argc, char* argv[]) return path (); }; + bool dump_load (false); + bool dump_match (false); + if (ops.dump_specified ()) + { + dump_load = ops.dump ().find ("load") != ops.dump ().end (); + dump_match = ops.dump ().find ("match") != ops.dump ().end (); + } + // If not NULL, then lifted points to the operation that has been "lifted" // to the meta-operaion (see the logic below for details). Skip is the // position of the next operation. @@ -1381,6 +1390,9 @@ main (int argc, char* argv[]) } } // target + if (dump_load) + dump (); + // Finally, match the rules and perform the operation. // if (pre_oid != 0) @@ -1402,6 +1414,9 @@ main (int argc, char* argv[]) if (mif->match != nullptr) mif->match (mparams, a, tgs, diag, true /* progress */); + if (dump_match) + dump (a); + if (mif->execute != nullptr && !ops.match_only ()) mif->execute (mparams, a, tgs, diag, true /* progress */); } @@ -1426,6 +1441,9 @@ main (int argc, char* argv[]) if (mif->match != nullptr) mif->match (mparams, a, tgs, diag, true /* progress */); + if (dump_match) + dump (a); + if (mif->execute != nullptr && !ops.match_only ()) mif->execute (mparams, a, tgs, diag, true /* progress */); } @@ -1451,6 +1469,9 @@ main (int argc, char* argv[]) if (mif->match != nullptr) mif->match (mparams, a, tgs, diag, true /* progress */); + if (dump_match) + dump (a); + if (mif->execute != nullptr && !ops.match_only ()) mif->execute (mparams, a, tgs, diag, true /* progress */); } |