From aba1015640643a11bbd98d8483805ca5dd8cbd96 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 19 May 2020 14:41:49 +0200 Subject: Add recipe library target state to cxx_rule --- libbuild2/rule.hxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'libbuild2/rule.hxx') diff --git a/libbuild2/rule.hxx b/libbuild2/rule.hxx index a3d54e7..50ed126 100644 --- a/libbuild2/rule.hxx +++ b/libbuild2/rule.hxx @@ -199,10 +199,17 @@ namespace build2 class LIBBUILD2_SYMEXPORT cxx_rule: public rule { public: - const location loc; // Buildfile location of the recipe. - explicit - cxx_rule (const location& l): loc (l) {} + // A robust recipe may want to incorporate the recipe_state into its + // up-to-date decision as if the recipe library was a prerequisite (it + // cannot be injected as a real prerequisite since it's from a different + // build context). + // + const location recipe_loc; // Buildfile location of the recipe. + const target_state recipe_state; // State of recipe library target. + + cxx_rule (const location& l, target_state s) + : recipe_loc (l), recipe_state (s) {} // Return true by default. // -- cgit v1.1