From abf8895cc8611c23bda243e027360d7f91d47cc5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 12 Mar 2019 14:08:11 +0200 Subject: Tweak resolution of relative targets from export.libs --- build2/cc/common.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/build2/cc/common.cxx b/build2/cc/common.cxx index 5ccb198..7844a4e 100644 --- a/build2/cc/common.cxx +++ b/build2/cc/common.cxx @@ -417,9 +417,13 @@ namespace build2 chain->pop_back (); } - // The name can be an absolute target name (e.g., /tmp/libfoo/lib{foo}) or - // a potentially project-qualified relative target name (e.g., - // libfoo%lib{foo}). + // The name can be an absolute or relative target name (for example, + // /tmp/libfoo/lib{foo} or ../libfoo/lib{foo}) or a project-qualified + // relative target name (e.g., libfoo%lib{foo}). + // + // Note that in case of the relative target that comes from export.libs, + // the resolution happens relative to the base scope of the target from + // which this export.libs came, which is exactly what we want. // // Note that the scope, search paths, and the link order should all be // derived from the library target that mentioned this name. This way we @@ -439,7 +443,7 @@ namespace build2 const target* xt (nullptr); - if (n.dir.absolute () && !n.qualified ()) + if (!n.qualified ()) { // Search for an existing target with this name "as if" it was a // prerequisite. -- cgit v1.1