From 879b5f52cb86f24352f4ed245fcce5f1ab885f97 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 30 Nov 2017 14:48:19 +0200 Subject: Implement support for scope operation callbacks An entity (module, core) can register a function that will be called when an action is executed on the dir{} target that corresponds to the scope. The pre callback is called just before the recipe and the post -- immediately after. --- build2/target.hxx | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) (limited to 'build2/target.hxx') diff --git a/build2/target.hxx b/build2/target.hxx index e541667..632e723 100644 --- a/build2/target.hxx +++ b/build2/target.hxx @@ -17,8 +17,9 @@ #include #include #include -#include #include +#include +#include #include namespace build2 @@ -34,38 +35,6 @@ namespace build2 const target& search (const target&, const prerequisite&); const target* search_existing (const prerequisite&); - // Target state. - // - enum class target_state: uint8_t - { - // The order of the enumerators is arranged so that their integral values - // indicate whether one "overrides" the other in the "merge" operator| - // (see below). - // - // Note that postponed is "greater" than unchanged since it may result in - // the changed state. - // - unknown, - unchanged, - postponed, - busy, - changed, - failed, - group // Target's state is the group's state. - }; - - ostream& - operator<< (ostream&, target_state); - - inline target_state& - operator |= (target_state& l, target_state r) - { - if (static_cast (r) > static_cast (l)) - l = r; - - return l; - } - // Recipe. // // The returned target state is normally changed or unchanged. If there is -- cgit v1.1