From abb7bf1045fde14f6ef87c8941ee22af233af397 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 3 Aug 2015 15:47:35 +0200 Subject: match_only rework, part 2 --- build/cxx/compile.cxx | 43 ++++++++++--------------------------------- 1 file changed, 10 insertions(+), 33 deletions(-) (limited to 'build/cxx/compile.cxx') diff --git a/build/cxx/compile.cxx b/build/cxx/compile.cxx index 48d2240..8dcad1e 100644 --- a/build/cxx/compile.cxx +++ b/build/cxx/compile.cxx @@ -98,46 +98,23 @@ namespace build // A dependency on a library is there so that we can get its // cxx.export.poptions. In particular, making sure it is // executed before us will only restrict parallelism. But we - // do need to match it in order to get its prerequisite_targets - // populated; see append_lib_options() above. + // do need to pre-match it in order to get its + // prerequisite_targets populated. This is the "library + // meta-information protocol". See also append_lib_options() + // above. // if (p.is_a () || p.is_a () || p.is_a ()) { if (a.operation () == update_id) { - // Handle imported libraries. + // Handle imported libraries. We know that for such libraries + // we don't need to do match() in order to get options (if + // any, they would be set by search_library()). // - if (p.proj () != nullptr) + if (p.proj () == nullptr || + link::search_library (lib_paths, p.prerequisite) == nullptr) { - // We know that for such libraries we don't need to do - // match() in order to get options (if any, they would - // be set by search_library()). - // - // @@ What if this is an installed import with an export - // stub? How will such a stub capture prerequsite libs? - // Probably as imported prerequisites, e.g., %lib{z}, not - // as -lz in .libs variable. - // - // In fact, even if we tried match() on lib{}, nothing - // would have matched since that lib{} is out of any - // project and is not a file (which is the case for - // liba/libso). So probably the importing code would - // have to take care of importing all the prerequisite - // libraries. It does make sense since we don't really - // want to match a rule to an installed library. - // - if (link::search_library (lib_paths, p.prerequisite) != nullptr) - continue; - } - - target& pt (p.search ()); - - if (p.is_a ()) //@@ TMP - build::match_only (a, pt); - else - { - build::match (a, pt); - pt.dependents--; + match_only (a, p.search ()); } } -- cgit v1.1