aboutsummaryrefslogtreecommitdiff
path: root/build2/target.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-11-30 14:48:19 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-11-30 14:48:19 +0200
commit879b5f52cb86f24352f4ed245fcce5f1ab885f97 (patch)
treeff483ce4aa64dda7d17b82f956333f0705257568 /build2/target.hxx
parent074a8c04a384a9752466bd2af69b695333b2955c (diff)
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.
Diffstat (limited to 'build2/target.hxx')
-rw-r--r--build2/target.hxx35
1 files changed, 2 insertions, 33 deletions
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 <build2/scope.hxx>
#include <build2/variable.hxx>
#include <build2/operation.hxx>
-#include <build2/target-type.hxx>
#include <build2/target-key.hxx>
+#include <build2/target-type.hxx>
+#include <build2/target-state.hxx>
#include <build2/prerequisite.hxx>
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<uint8_t> (r) > static_cast<uint8_t> (l))
- l = r;
-
- return l;
- }
-
// Recipe.
//
// The returned target state is normally changed or unchanged. If there is