aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/config/init.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-09-20 09:03:44 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-09-20 09:03:44 +0200
commit77bef9b64857b1d2ae96dafc2f531cadb374f561 (patch)
treef246f3ebc62116263521d87b7d74dba7efc2f0ae /libbuild2/config/init.cxx
parentb43546939b21f6c8d3e69d4ab1e44f08c0756481 (diff)
Fix issue with fallback rule priority in dist module
While at it, also remove workarounds for the same issue in the config and test modules.
Diffstat (limited to 'libbuild2/config/init.cxx')
-rw-r--r--libbuild2/config/init.cxx22
1 files changed, 13 insertions, 9 deletions
diff --git a/libbuild2/config/init.cxx b/libbuild2/config/init.cxx
index d42bace..38590ae 100644
--- a/libbuild2/config/init.cxx
+++ b/libbuild2/config/init.cxx
@@ -26,6 +26,8 @@ namespace build2
{
namespace config
{
+ static const file_rule file_rule_ (true /* check_type */);
+
void
functions (function_map&); // functions.cxx
@@ -712,21 +714,23 @@ namespace build2
// Register alias and fallback rule for the configure meta-operation.
//
+ rs.insert_rule<alias> (configure_id, 0, "config.alias", alias_rule::instance);
+
+ // This allows a custom configure rule while doing nothing by default.
+ //
+ rs.insert_rule<target> (configure_id, 0, "config.noop", noop_rule::instance);
+
// We need this rule for out-of-any-project dependencies (for example,
// libraries imported from /usr/lib). We are registering it on the
// global scope similar to builtin rules.
//
- // See a similar rule in the dist module.
+ // Note: use target instead of anything more specific (such as
+ // mtime_target) in order not to take precedence over the rules above.
//
- rs.global_scope ().insert_rule<mtime_target> (
- configure_id, 0, "config.file", file_rule::instance);
-
- rs.insert_rule<alias> (configure_id, 0, "config.alias", alias_rule::instance);
-
- // This allows a custom configure rule while doing nothing by default.
+ // See a similar rule in the dist module.
//
- rs.insert_rule<target> (configure_id, 0, "config.noop", noop_rule::instance);
- rs.insert_rule<file> (configure_id, 0, "config.noop", noop_rule::instance);
+ rs.global_scope ().insert_rule<target> (
+ configure_id, 0, "config.file", file_rule_);
return true;
}