From 894813b993963de006d0a8aa7480b0403daaa87a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 13 Apr 2023 13:55:00 +0200 Subject: Move cli module to libbuild2-cli library This is a temporary measure (until we unboundle this module) needed for in-process configure support in bpkg. --- libbuild2/cli/rule.hxx | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 libbuild2/cli/rule.hxx (limited to 'libbuild2/cli/rule.hxx') diff --git a/libbuild2/cli/rule.hxx b/libbuild2/cli/rule.hxx new file mode 100644 index 0000000..0132b44 --- /dev/null +++ b/libbuild2/cli/rule.hxx @@ -0,0 +1,46 @@ +// file : libbuild2/cli/rule.hxx -*- C++ -*- +// license : MIT; see accompanying LICENSE file + +#ifndef LIBBUILD2_CLI_RULE_HXX +#define LIBBUILD2_CLI_RULE_HXX + +#include +#include + +#include + +#include + +namespace build2 +{ + namespace cli + { + // Cached data shared between rules and the module. + // + struct data + { + const exe& ctgt; // CLI compiler target. + const string& csum; // CLI compiler checksum. + }; + + // @@ Redo as two separate rules? + // + class LIBBUILD2_CLI_SYMEXPORT compile_rule: public simple_rule, + private virtual data + { + public: + compile_rule (data&& d): data (move (d)) {} + + virtual bool + match (action, target&) const override; + + virtual recipe + apply (action, target&) const override; + + target_state + perform_update (action, const target&) const; + }; + } +} + +#endif // LIBBUILD2_CLI_RULE_HXX -- cgit v1.1