From c106259517d7693ea8e24564bc890fe575d5edcd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 16 Jan 2015 14:11:14 +0200 Subject: Implement rule chaining for cxx::link --- build/target | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'build/target') diff --git a/build/target b/build/target index 508aedb..f57e8cc 100644 --- a/build/target +++ b/build/target @@ -12,7 +12,7 @@ #include // unique_ptr #include // function, reference_wrapper #include -#include +#include #include #include // move @@ -36,6 +36,12 @@ namespace build target* (*const factory) (path, std::string, const std::string*); }; + inline std::ostream& + operator<< (std::ostream& os, const target_type& tt) + { + return os << tt.name; + } + class target { public: @@ -104,7 +110,16 @@ namespace build x.ext != nullptr && y.ext != nullptr && x.ext < y.ext); } - typedef std::set, compare_pointer_target> target_set; + struct target_set: std::set, compare_pointer_target> + { + std::pair + insert (const target_type&, + path dir, + std::string name, + const std::string* ext, + tracer&); + }; + extern target_set targets; extern target* default_target; @@ -170,7 +185,7 @@ namespace build path () const {return path_;} void - path (path_type p) {assert (path_.empty ()); path_ = p;} + path (path_type p) {assert (path_.empty ()); path_ = std::move (p);} protected: virtual timestamp -- cgit v1.1