diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-06-09 07:40:54 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-06-09 07:40:54 +0200 |
commit | b8cffb11a45add241e4b8420ba96e116efccfbd9 (patch) | |
tree | 70bc6987e60c7415b351111517a4bc7eea74f93c /libbuild2/target.txx | |
parent | dd1cb295722a049fe21c8d0311cb1823ccb0e508 (diff) |
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.
Diffstat (limited to 'libbuild2/target.txx')
-rw-r--r-- | libbuild2/target.txx | 5 |
1 files changed, 3 insertions, 2 deletions
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<names> (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<T> (vars[(*ns)[1].value + '.' + var]); } |