From 3813b05824fa2616b8ab9c18ed158c0c02265337 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 27 Apr 2018 12:01:09 +0200 Subject: Add support for build hooks The following buildfiles are loaded (if present) at appropriate times from the out_root subdirectories of a project: build/bootstrap/pre-*.build # before loading bootstrap.build build/bootstrap/post-*.build # after loading bootstrap.build build/root/pre-*.build # before loading root.build build/root/post-*.build # after loading root.build --- build2/file.ixx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'build2/file.ixx') diff --git a/build2/file.ixx b/build2/file.ixx index 15fa8dc..ef944cf 100644 --- a/build2/file.ixx +++ b/build2/file.ixx @@ -26,4 +26,19 @@ namespace build2 assert (phase == run_phase::match || phase == run_phase::execute); return import (pk, true); } + + void + source_hooks (scope&, const dir_path&, bool); + + inline void + bootstrap_pre (scope& root) + { + source_hooks (root, bootstrap_dir, true /* pre */); + } + + inline void + bootstrap_post (scope& root) + { + source_hooks (root, bootstrap_dir, false /* pre */); + } } -- cgit v1.1