From 534ca7619a62a74bce8e4b30931aaf99f9c3beb6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 16 Aug 2020 16:21:35 +0200 Subject: Add support for post-configure and pre-disfigure hooks --- libbuild2/config/module.cxx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'libbuild2/config/module.cxx') diff --git a/libbuild2/config/module.cxx b/libbuild2/config/module.cxx index 96107cc..6b0c82a 100644 --- a/libbuild2/config/module.cxx +++ b/libbuild2/config/module.cxx @@ -67,6 +67,30 @@ namespace build2 m->save_module (name, prio); } + bool module:: + configure_post (scope& rs, configure_post_hook* h) + { + if (module* m = rs.find_module (module::name)) + { + m->configure_post_.push_back (h); + return true; + } + + return false; + } + + bool module:: + disfigure_pre (scope& rs, disfigure_pre_hook* h) + { + if (module* m = rs.find_module (module::name)) + { + m->disfigure_pre_.push_back (h); + return true; + } + + return false; + } + const string module::name ("config"); const uint64_t module::version (1); } -- cgit v1.1