From 50d93195e9a67b75fdd87b6fe0106af2da4d56f8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 27 Sep 2022 09:10:38 +0200 Subject: Improve diagnostics for multiple targets sharing path --- libbuild2/operation.cxx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/libbuild2/operation.cxx b/libbuild2/operation.cxx index 9fbf870..412e07f 100644 --- a/libbuild2/operation.cxx +++ b/libbuild2/operation.cxx @@ -226,9 +226,19 @@ namespace build2 } else if (t->decl != target_decl::real) { - dr << info << "target " << *t << " is not explicitly declared " - << "in any buildfile" << - info << "perhaps it is a dynamic dependency?"; + if (t->decl == target_decl::implied) + { + dr << info << "target " << *t << " is implied by a buildfile"; + } + else + { + dr << info << "target " << *t << " is not declared in a buildfile"; + + if (t->decl == target_decl::prereq_file) + dr << " but has corresponding existing file"; + + dr << info << "perhaps it is a dynamic dependency?"; + } } } } -- cgit v1.1