diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2022-08-17 14:46:08 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2022-08-17 14:46:08 +0200 |
commit | fe94baf3fe7b7d6d4f97c9e6841c0d9b2915d810 (patch) | |
tree | 3a4a4882f6b6c8a41c35fb040a4d3e6e98015881 /libbuild2/cc | |
parent | a62e014060770f478216cc5c18416fb5d5df9eb4 (diff) |
Fix bug in handling of "in *.export.libs but not in prerequisites" case
Diffstat (limited to 'libbuild2/cc')
-rw-r--r-- | libbuild2/cc/common.cxx | 21 |
1 files 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. // |