From b8cffb11a45add241e4b8420ba96e116efccfbd9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 9 Jun 2020 07:40:54 +0200 Subject: Make metadata variable prefix mandatory While we could automatically set it if the target is imported, there is nothing we can do if the target is used in the same project. So to avoid confusion we make it mandatory. --- libbuild2/target.txx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libbuild2/target.txx') diff --git a/libbuild2/target.txx b/libbuild2/target.txx index ef14cf5..777653a 100644 --- a/libbuild2/target.txx +++ b/libbuild2/target.txx @@ -188,9 +188,10 @@ namespace build2 { if (auto* ns = cast_null (vars[ctx.var_export_metadata])) { - // Metadata variable prefix is in the second name. + // Metadata variable prefix must be in the second name. // - assert (ns->size () == 2 && (*ns)[1].simple ()); + if (ns->size () < 2 || !(*ns)[1].simple ()) + fail << "invalid metadata variable prefix in target " << *this; return cast_null (vars[(*ns)[1].value + '.' + var]); } -- cgit v1.1