aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/install-rule.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/cc/install-rule.cxx')
-rw-r--r--libbuild2/cc/install-rule.cxx34
1 files changed, 22 insertions, 12 deletions
diff --git a/libbuild2/cc/install-rule.cxx b/libbuild2/cc/install-rule.cxx
index fff3bdf..f6e6b71 100644
--- a/libbuild2/cc/install-rule.cxx
+++ b/libbuild2/cc/install-rule.cxx
@@ -259,7 +259,9 @@ namespace build2
}
}
- recipe r (file_rule::apply_impl (a, t, me));
+ recipe r (file_rule::apply_impl (
+ a, t, me,
+ me.cur_options != match_extra::all_options /* reapply */));
if (r == nullptr)
{
@@ -326,26 +328,34 @@ namespace build2
<< ' ' << me.cur_options
<< ' ' << me.new_options; // @@ TMP
- // If we are rematched with the buildtime option, propagate it to our
- // prerequisite libraries.
+ me.cur_options |= me.new_options;
+
+ // We also need to update options in install_match_data.
//
+ t.data<install_match_data> (a).options = me.cur_options;
+
if ((me.new_options & lib::option_install_buildtime) != 0)
{
+ // If we are rematched with the buildtime option, propagate it to our
+ // prerequisite libraries.
+ //
for (const target* pt: t.prerequisite_targets[a])
{
if (pt != nullptr && (pt->is_a<liba> () || pt->is_a<libs> () ||
pt->is_a<libua> () || pt->is_a<libus> ()))
- rematch_sync (a, *pt, lib::option_install_buildtime);
+ {
+ // Go for all options instead of just install_buildtime to avoid
+ // any further relocking/reapply (we only support runtime-only or
+ // everything).
+ //
+ rematch_sync (a, *pt, match_extra::all_options);
+ }
}
- }
-
- // @@ TODO: match additional prerequisites if required.
-
- me.cur_options |= me.new_options;
- // We also need to update options in install_match_data.
- //
- t.data<install_match_data> (a).options = me.cur_options;
+ // Also match any additional prerequisites (e.g., headers).
+ //
+ file_rule::reapply_impl (a, t, me);
+ }
}
bool install_rule::