From f8de93520fd604a3771a2af3ca9564f6085d8baa Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 1 Dec 2022 10:00:37 +0200 Subject: Make dist::rule reusable as base --- libbuild2/dist/operation.cxx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'libbuild2/dist/operation.cxx') diff --git a/libbuild2/dist/operation.cxx b/libbuild2/dist/operation.cxx index e5c9307..af7b40b 100644 --- a/libbuild2/dist/operation.cxx +++ b/libbuild2/dist/operation.cxx @@ -16,6 +16,7 @@ #include #include +#include #include using namespace std; @@ -237,10 +238,7 @@ namespace build2 fail << "unknown distribution package name" << info << "did you forget to set dist.package?"; - // Need non-const in order to clear postponed. This is safe since only - // doing it when running serially. - // - module& mod (const_cast (*rs.find_module (module::name))); + const module& mod (*rs.find_module (module::name)); const string& dist_package (cast (l)); const process_path& dist_cmd (cast (rs.vars["dist.cmd"])); @@ -301,9 +299,7 @@ namespace build2 for (auto i (mod.postponed.list.begin ()); i != mod.postponed.list.end (); ++i) - { - rule::match_postponed (i->action, i->target, i->prereq); - } + rule::match_postponed (*i); } }; -- cgit v1.1