From 743273bd381a132c272226af00381da0494e8920 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 15 Feb 2022 15:59:22 +0200 Subject: Diagnose various misuses of library metadata protocol --- libbuild2/cc/functions.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libbuild2/cc/functions.cxx') diff --git a/libbuild2/cc/functions.cxx b/libbuild2/cc/functions.cxx index e05c707..8a48e66 100644 --- a/libbuild2/cc/functions.cxx +++ b/libbuild2/cc/functions.cxx @@ -74,6 +74,11 @@ namespace build2 { name& n (*i), o; const target& t (to_target (*bs, move (n), move (n.pair ? *++i : o))); + + if (!t.matched (a)) + fail << t << " is not matched" << + info << "make sure this target is listed as prerequisite"; + d.f (r, vs, *m, *bs, a, t); } @@ -174,6 +179,10 @@ namespace build2 (la = (f = t.is_a ())) || ( (f = t.is_a ()))) { + if (!t.matched (a)) + fail << t << " is not matched" << + info << "make sure this target is listed as prerequisite"; + d.f (ls, r, vs, *m, *bs, a, *f, la, li); } else -- cgit v1.1