aboutsummaryrefslogtreecommitdiff
path: root/build/rule
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-01-15 11:03:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-01-15 11:03:06 +0200
commitdf50091259a34fa4718f38c0e3b7b64f6e2469ac (patch)
tree2d3172068f9ea1f4ecc6599192c42ac4172d9cfc /build/rule
parentc59ce78f409db8bb53042380903c8ece8b8fbd28 (diff)
Implement rule ambiguity detection
Also establish the infrastructure for rule hinting
Diffstat (limited to 'build/rule')
-rw-r--r--build/rule11
1 files changed, 7 insertions, 4 deletions
diff --git a/build/rule b/build/rule
index 6bb58fe..91ef0ca 100644
--- a/build/rule
+++ b/build/rule
@@ -5,11 +5,13 @@
#ifndef BUILD_RULE
#define BUILD_RULE
+#include <string>
#include <typeindex>
#include <functional> // reference_wrapper
#include <unordered_map>
#include <build/target>
+#include <build/prefix_map>
namespace build
{
@@ -17,11 +19,12 @@ namespace build
{
public:
virtual recipe
- match (target&) const = 0;
+ match (target&, bool single, std::string& hint) const = 0;
};
- typedef std::unordered_multimap<std::type_index,
- std::reference_wrapper<rule>> rule_map;
+ typedef std::unordered_map<
+ std::type_index,
+ prefix_multimap<std::string, std::reference_wrapper<rule>, '.'>> rule_map;
extern rule_map rules;
@@ -29,7 +32,7 @@ namespace build
{
public:
virtual recipe
- match (target&) const;
+ match (target&, bool single, std::string& hint) const;
static target_state
update (target&);