From 4f5c9357b7e17b4fb9ecaad36c8740a05cfc1bc6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 27 Jun 2022 13:11:06 +0200 Subject: Add support for rule-specific import phase 2 For example: import! [metadata, rule_hint=cxx.link] lib = libhello%lib{hello} --- libbuild2/rule.hxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libbuild2/rule.hxx') diff --git a/libbuild2/rule.hxx b/libbuild2/rule.hxx index 77c2d2c..da069ef 100644 --- a/libbuild2/rule.hxx +++ b/libbuild2/rule.hxx @@ -52,6 +52,21 @@ namespace build2 rule (const rule&) = delete; rule& operator= (const rule&) = delete; + // Resolve a project-qualified target in a rule-specific manner. + // + // This is optional functionality that may be provided by some rules to + // facilitate immediate importation of certain target types. See the + // import machinery for details. The default implementation always returns + // NULL. + // + // Note that if this function returns a target, it should have the + // extension assigned so that as_name() returns a stable name. + // + virtual const target* + import (const prerequisite_key&, + const optional& metadata, + const location&) const; + // Sometimes we want to match only if another rule of ours would match // another operation. For example, we would want our install rule to match // only if our update rule also matches. -- cgit v1.1