aboutsummaryrefslogtreecommitdiff
path: root/build/install/rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-12-12 13:46:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-12-12 13:46:07 +0200
commitad4120afce8c7bc4001fc0173a0ff7611ec0198d (patch)
treeebbc31d03feda96560df437247b63206489a1139 /build/install/rule.cxx
parentdd4a389117812f0d3b45473d87214d67d0cb4a3a (diff)
Implement installation of prerequisite shared libraries
Diffstat (limited to 'build/install/rule.cxx')
-rw-r--r--build/install/rule.cxx29
1 files changed, 14 insertions, 15 deletions
diff --git a/build/install/rule.cxx b/build/install/rule.cxx
index bd538ed..3f8c16a 100644
--- a/build/install/rule.cxx
+++ b/build/install/rule.cxx
@@ -100,6 +100,13 @@ namespace build
return mr;
}
+ target* file_rule::
+ filter (action, target& t, prerequisite_member p) const
+ {
+ target& pt (p.search ());
+ return pt.in (t.root_scope ()) ? &pt : nullptr;
+ }
+
recipe file_rule::
apply (action a, target& t, const match_result& mr) const
{
@@ -121,8 +128,6 @@ namespace build
// run standard search_and_match()? Will need an indicator
// that it was forced (e.g., [install]) for filter() below.
//
- scope& rs (t.root_scope ());
-
for (prerequisite_member p: group_prerequisite_members (a, t))
{
// Ignore unresolved targets that are imported from other projects.
@@ -136,19 +141,13 @@ namespace build
// Let a customized rule have its say.
//
- // @@ This will be skipped if forced with [install].
+ // @@ This will be skipped if forced with [install]?
//
- if (!filter (a, t, p))
+ target* pt (filter (a, t, p));
+ if (pt == nullptr)
continue;
- target& pt (p.search ());
-
- // Ignore targets that are outside of our project.
- //
- if (!pt.in (rs))
- continue;
-
- build::match (a, pt);
+ build::match (a, *pt);
// If the matched rule returned noop_recipe, then the target
// state will be set to unchanged as an optimization. Use this
@@ -156,10 +155,10 @@ namespace build
// will help a lot in case of any static installable content
// (headers, documentation, etc).
//
- if (pt.state () != target_state::unchanged)
- t.prerequisite_targets.push_back (&pt);
+ if (pt->state () != target_state::unchanged)
+ t.prerequisite_targets.push_back (pt);
else
- unmatch (a, pt); // No intent to execute.
+ unmatch (a, *pt); // No intent to execute.
}
// This is where we diverge depending on the operation. In the