aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/target.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/target.cxx')
-rw-r--r--libbuild2/target.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/libbuild2/target.cxx b/libbuild2/target.cxx
index 5e6db5a..9d81dee 100644
--- a/libbuild2/target.cxx
+++ b/libbuild2/target.cxx
@@ -290,6 +290,34 @@ namespace build2
}
}
+ // include()
+ //
+ include_type
+ include_impl (action a,
+ const target& t,
+ const string& v,
+ const prerequisite& p,
+ const target* m)
+ {
+ context& ctx (t.ctx);
+
+ include_type r (false);
+
+ if (v == "false") r = include_type::excluded;
+ else if (v == "adhoc") r = include_type::adhoc;
+ else if (v == "true") r = include_type::normal;
+ else
+ fail << "invalid " << ctx.var_include->name << " variable value "
+ << "'" << v << "' specified for prerequisite " << p;
+
+ // Call the meta-operation override, if any (currently used by dist).
+ //
+ if (auto f = ctx.current_mif->include)
+ r = f (a, t, prerequisite_member {p, m}, r);
+
+ return r;
+ }
+
// target_set
//
const target* target_set::