diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-08-24 12:56:35 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-08-24 12:56:35 +0200 |
commit | 190af1175755e2a76b1ac182414ae261a15bb276 (patch) | |
tree | 30d524c146814fc284e69553ecdf9c387121e4dd | |
parent | 3bfd12396f6ad66d2864e9fb5ba8be2e531a4e63 (diff) |
Only suggest ad hoc path import for path-based targets
-rw-r--r-- | libbuild2/file.cxx | 16 |
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; |