From 920ed11a433b0e292a18adb8c68829a00e8c70cc Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 26 May 2020 21:35:59 +0300 Subject: Allow process path values and targets as buildscript program names Also deduce the recipe name. --- libbuild2/target.txx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'libbuild2/target.txx') diff --git a/libbuild2/target.txx b/libbuild2/target.txx index b482d64..ef14cf5 100644 --- a/libbuild2/target.txx +++ b/libbuild2/target.txx @@ -179,4 +179,22 @@ namespace build2 t.prerequisites (move (ps)); return &t; } + + // exe + // + template + const T* exe:: + lookup_metadata (const char* var) const + { + if (auto* ns = cast_null (vars[ctx.var_export_metadata])) + { + // Metadata variable prefix is in the second name. + // + assert (ns->size () == 2 && (*ns)[1].simple ()); + + return cast_null (vars[(*ns)[1].value + '.' + var]); + } + + return nullptr; + } } -- cgit v1.1