From 96908ec43ed27d9f34da27b6a94a6db357465056 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 14 May 2020 14:18:50 +0300 Subject: Add build script --- libbuild2/build/script/runner.cxx | 50 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 libbuild2/build/script/runner.cxx (limited to 'libbuild2/build/script/runner.cxx') diff --git a/libbuild2/build/script/runner.cxx b/libbuild2/build/script/runner.cxx new file mode 100644 index 0000000..f52d1c0 --- /dev/null +++ b/libbuild2/build/script/runner.cxx @@ -0,0 +1,50 @@ +// file : libbuild2/build/script/runner.cxx -*- C++ -*- +// license : MIT; see accompanying LICENSE file + +#include + +#include + +namespace build2 +{ + namespace build + { + namespace script + { + void default_runner:: + enter (environment&, const location&) + { + // Noop. + } + + void default_runner:: + leave (environment& env, const location& ll) + { + clean (env, ll); + } + + void default_runner:: + run (environment& env, + const command_expr& expr, + size_t li, + const location& ll) + { + if (verb >= 3) + text << ": " << expr; + + build2::script::run (env, expr, li, ll); + } + + bool default_runner:: + run_if (environment& env, + const command_expr& expr, + size_t li, const location& ll) + { + if (verb >= 3) + text << ": ?" << expr; + + return build2::script::run_if (env, expr, li, ll); + } + } + } +} -- cgit v1.1