From 190af1175755e2a76b1ac182414ae261a15bb276 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 24 Aug 2020 12:56:35 +0200 Subject: Only suggest ad hoc path import for path-based targets --- libbuild2/file.cxx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/libbuild2/file.cxx b/libbuild2/file.cxx index 252f885..d60a2dc 100644 --- a/libbuild2/file.cxx +++ b/libbuild2/file.cxx @@ -2666,14 +2666,18 @@ namespace build2 dr << info << "use config.import." << projv << " configuration variable " << "to specify its project out_root"; - // Suggest ad hoc import. + // Suggest ad hoc import but only if it's a path-based target (doing it + // for lib{} is very confusing). // - string v (tt.is_a () && (projv == *tk.name || proj == *tk.name) - ? "config." + projv - : "config.import." + projv + '.' + *tk.name + '.' + tt.name); + if (tt.is_a ()) + { + string v (tt.is_a () && (projv == *tk.name || proj == *tk.name) + ? "config." + projv + : "config.import." + projv + '.' + *tk.name + '.' + tt.name); - dr << info << "or use " << v << " configuration variable to specify its " - << "path"; + dr << info << "or use " << v << " configuration variable to specify " + << "its path"; + } } dr << endf; -- cgit v1.1