From 1b80ce6765eb555f6e9dfcfa995415811640d4be Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 11 Nov 2020 15:03:38 +0200 Subject: Add context::current_action() --- libbuild2/context.hxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libbuild2/context.hxx b/libbuild2/context.hxx index 0790355..e3ffa3a 100644 --- a/libbuild2/context.hxx +++ b/libbuild2/context.hxx @@ -269,11 +269,19 @@ namespace build2 const operation_info* current_inner_oif; const operation_info* current_outer_oif; + action + current_action () const + { + return action (current_mif->id, + current_inner_oif->id, + current_outer_oif != nullptr ? current_outer_oif->id : 0); + } + // Check whether this is the specified meta-operation during bootstrap // (when current_mif may not be yet known). // bool - bootstrap_meta_operation (const char* mo) + bootstrap_meta_operation (const char* mo) const { return ((current_mname == mo ) || (current_mname.empty () && current_oname == mo)); -- cgit v1.1