diff options
Diffstat (limited to 'build2/target.hxx')
-rw-r--r-- | build2/target.hxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/build2/target.hxx b/build2/target.hxx index 761cb4e..515a082 100644 --- a/build2/target.hxx +++ b/build2/target.hxx @@ -15,8 +15,8 @@ #include <build2/utility.hxx> #include <build2/scope.hxx> +#include <build2/action.hxx> #include <build2/variable.hxx> -#include <build2/operation.hxx> #include <build2/target-key.hxx> #include <build2/target-type.hxx> #include <build2/target-state.hxx> @@ -92,14 +92,18 @@ namespace build2 { using target_type = build2::target; - prerequisite_target (const target_type* t, uintptr_t d = 0) - : target (t), data (d) {} + prerequisite_target (const target_type* t, bool a = false, uintptr_t d = 0) + : target (t), adhoc (a), data (d) {} + + prerequisite_target (const target_type* t, include_type a, uintptr_t d = 0) + : prerequisite_target (t, a == include_type::adhoc, d) {} operator const target_type*& () {return target;} operator const target_type* () const {return target;} const target_type* operator-> () const {return target;} const target_type* target; + bool adhoc; // True if include=adhoc. uintptr_t data; }; using prerequisite_targets = vector<prerequisite_target>; @@ -932,6 +936,12 @@ namespace build2 return os << pm.key (); } + inline include_type + include (action a, const target& t, const prerequisite_member& pm) + { + return include (a, t, pm.prerequisite, pm.member); + } + // A "range" that presents a sequence of prerequisites (e.g., from // group_prerequisites()) as a sequence of prerequisite_member's. For each // group prerequisite you will "see" either the prerequisite itself or all |