aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-08-24 12:56:35 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-08-24 12:56:35 +0200
commit190af1175755e2a76b1ac182414ae261a15bb276 (patch)
tree30d524c146814fc284e69553ecdf9c387121e4dd
parent3bfd12396f6ad66d2864e9fb5ba8be2e531a4e63 (diff)
Only suggest ad hoc path import for path-based targets
-rw-r--r--libbuild2/file.cxx16
1 files 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<exe> () && (projv == *tk.name || proj == *tk.name)
- ? "config." + projv
- : "config.import." + projv + '.' + *tk.name + '.' + tt.name);
+ if (tt.is_a<path_target> ())
+ {
+ string v (tt.is_a<exe> () && (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;