aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/scope.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-02-10 07:35:19 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-02-10 07:35:19 +0200
commit03eeea3b6c083ec9f9e755a2505d559b70c6cf0d (patch)
tree38e0fc927e3f33dcb1b8ce892712d33db4e40ca3 /libbuild2/scope.ixx
parent4e88e3bce9027e5832531654a7dd62fcafad3b08 (diff)
Reorder inline function definition to help with MinGW GCC symbol export
Diffstat (limited to 'libbuild2/scope.ixx')
-rw-r--r--libbuild2/scope.ixx31
1 files changed, 31 insertions, 0 deletions
diff --git a/libbuild2/scope.ixx b/libbuild2/scope.ixx
index e123e4a..d297720 100644
--- a/libbuild2/scope.ixx
+++ b/libbuild2/scope.ixx
@@ -173,6 +173,37 @@ namespace build2
this};
}
+ template <typename T>
+ inline void scope::
+ insert_rule (meta_operation_id mid, operation_id oid,
+ string hint,
+ const rule& r)
+ {
+ if (mid != 0)
+ rules.insert<T> (mid, oid, move (hint), r);
+ else
+ {
+ auto& ms (root_scope ()->root_extra->meta_operations);
+
+ for (size_t i (1), n (ms.size ()); i != n; ++i)
+ {
+ if (ms[i] != nullptr)
+ {
+ // Skip a few well-known meta-operations that cannot possibly
+ // trigger a rule match.
+ //
+ mid = static_cast<meta_operation_id> (i);
+
+ if (mid != noop_id &&
+ mid != info_id &&
+ mid != create_id &&
+ mid != disfigure_id)
+ rules.insert<T> (mid, oid, hint, r);
+ }
+ }
+ }
+ }
+
inline dir_path
src_out (const dir_path& out, const scope& r)
{