aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/link-rule.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-05-06 09:57:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-05-06 09:57:03 +0200
commit17305d124705d9ab8cd89d1355f4ec6aacbf540a (patch)
tree23a8a96ed3a735f107038e4b85de977ec1e79b18 /libbuild2/cc/link-rule.hxx
parent272dbd99d21591b694ba608f8daea75806d5fcbc (diff)
Propagate complete match rules from utility libraries in link rule
This makes sure mixed-language (e.g., C and C++) utility libraries behave as expected.
Diffstat (limited to 'libbuild2/cc/link-rule.hxx')
-rw-r--r--libbuild2/cc/link-rule.hxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/libbuild2/cc/link-rule.hxx b/libbuild2/cc/link-rule.hxx
index 33a4f1c..c49d20f 100644
--- a/libbuild2/cc/link-rule.hxx
+++ b/libbuild2/cc/link-rule.hxx
@@ -32,6 +32,16 @@ namespace build2
bool seen_cc = false;
bool seen_obj = false;
bool seen_lib = false;
+
+ match_result& operator|= (match_result y)
+ {
+ seen_x = seen_x || y.seen_x;
+ seen_c = seen_c || y.seen_c;
+ seen_cc = seen_cc || y.seen_cc;
+ seen_obj = seen_obj || y.seen_obj;
+ seen_lib = seen_lib || y.seen_lib;
+ return *this;
+ }
};
match_result