From fe94baf3fe7b7d6d4f97c9e6841c0d9b2915d810 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 17 Aug 2022 14:46:08 +0200 Subject: Fix bug in handling of "in *.export.libs but not in prerequisites" case --- libbuild2/cc/common.cxx | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/libbuild2/cc/common.cxx b/libbuild2/cc/common.cxx index ded2902..9b82572 100644 --- a/libbuild2/cc/common.cxx +++ b/libbuild2/cc/common.cxx @@ -611,25 +611,36 @@ namespace build2 ; // See above. else if (l.ctx.phase == run_phase::match) { - if (!t->matched (a)) - w = "not matched"; + // We allow not matching installed libraries if all we need + // is their options (see compile_rule::apply()). + // + if (proc_lib || t->base_scope ().root_scope () != nullptr) + { + if (!t->matched (a)) + w = "not matched"; + } } - else if (proc_lib) + else { // Note that this check we only do if there is proc_lib // (since it's valid to process library's options before // updating it). // - if (t->mtime () == timestamp_unknown) - w = "out of date"; + if (proc_lib) + { + if (t->mtime () == timestamp_unknown) + w = "out of date"; + } } if (w != nullptr) + { fail << (impl ? "implementation" : "interface") << " dependency " << *t << " is " << w << info << "mentioned in *.export." << (impl ? "impl_" : "") << "libs of target " << l << info << "is it a prerequisite of " << l << "?"; + } // Process it recursively. // -- cgit v1.1