aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbuild2/install/init.cxx6
-rw-r--r--libbuild2/test/init.cxx14
2 files changed, 18 insertions, 2 deletions
diff --git a/libbuild2/install/init.cxx b/libbuild2/install/init.cxx
index 14cf6ca..31e0f7a 100644
--- a/libbuild2/install/init.cxx
+++ b/libbuild2/install/init.cxx
@@ -334,6 +334,12 @@ namespace build2
bs.insert_rule<target> (perform_install_id, "install.file", gr);
bs.insert_rule<target> (perform_uninstall_id, "uninstall.file", gr);
+
+ // Register the fallback file rule for the update-for-install
+ // operation, similar to update.
+ //
+ rs.global_scope ().insert_rule<mtime_target> (
+ perform_install_id, "file", file_rule::instance);
}
// Configuration.
diff --git a/libbuild2/test/init.cxx b/libbuild2/test/init.cxx
index 7a07e76..02d0a42 100644
--- a/libbuild2/test/init.cxx
+++ b/libbuild2/test/init.cxx
@@ -208,8 +208,18 @@ namespace build2
{
default_rule& dr (m);
- rs.insert_rule<target> (perform_test_id, "test", dr);
- rs.insert_rule<alias> (perform_test_id, "test", dr);
+ // Note: register for mtime_target to take priority over the fallback
+ // rule below.
+ //
+ rs.insert_rule<target> (perform_test_id, "test", dr);
+ rs.insert_rule<mtime_target> (perform_test_id, "test", dr);
+ rs.insert_rule<alias> (perform_test_id, "test", dr);
+
+ // Register the fallback file rule for the update-for-test operation,
+ // similar to update.
+ //
+ rs.global_scope ().insert_rule<mtime_target> (
+ perform_test_id, "file", file_rule::instance);
}
return true;