diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-02-14 12:32:59 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-02-14 14:53:51 +0200 |
commit | a523eb1b8b74a577e7ff0aa3fce4312acd4b3a75 (patch) | |
tree | 3cac12cad917eccfe8fffb57c7279f2d09bde0ca /build2/cc/compile.cxx | |
parent | 8a7b3bb944ca08d240fc778a9269c6db0f9746f8 (diff) |
Redo library meta-information protocol without match_only()
Diffstat (limited to 'build2/cc/compile.cxx')
-rw-r--r-- | build2/cc/compile.cxx | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx index 3039f00..c04f0a9 100644 --- a/build2/cc/compile.cxx +++ b/build2/cc/compile.cxx @@ -278,11 +278,8 @@ namespace build2 for (prerequisite_member p: group_prerequisite_members (ml, a, t)) { // A dependency on a library is there so that we can get its - // *.export.poptions. In particular, making sure it is executed before - // us will only restrict parallelism. But we do need to pre-match it - // in order to get its imports resolved and prerequisite_targets - // populated. This is the "library meta-information protocol". See - // also append_lib_options(). + // *.export.poptions. This is the "library meta-information + // protocol". See also append_lib_options(). // if (p.is_a<lib> () || p.is_a<liba> () || p.is_a<libs> ()) { @@ -305,7 +302,17 @@ namespace build2 if (lib* l = pt->is_a<lib> ()) pt = &link_member (*l, lo); - match_only (ml, a, *pt); + // Making sure it is executed before us will only restrict + // parallelism. But we do need to match it in order to get its + // imports resolved and prerequisite_targets populated. So we + // match it but then unmatch if it is safe. And thanks to the + // two-pass prerequisite search & match in link::apply() it will + // be safe unless someone is building an obj?{} target directory. + // + if (build2::match (ml, a, *pt)) + unmatch (a, *pt); + else + t.prerequisite_targets.push_back (pt); } continue; |