aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-10-27 07:22:00 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-10-27 07:22:00 +0200
commita5418d62f79f7d59f6b0a7efc88dcd7e99c8248a (patch)
tree84686c37b666eae4a52b0fda763afeeefca3461f /libbuild2/cc
parent152f83d22861129dba48404632b61b3f00f18715 (diff)
WIP: install: file_rule::reapply_impl()
Diffstat (limited to 'libbuild2/cc')
-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::