aboutsummaryrefslogtreecommitdiff
path: root/build/target
diff options
context:
space:
mode:
Diffstat (limited to 'build/target')
-rw-r--r--build/target21
1 files changed, 18 insertions, 3 deletions
diff --git a/build/target b/build/target
index 508aedb..f57e8cc 100644
--- a/build/target
+++ b/build/target
@@ -12,7 +12,7 @@
#include <memory> // unique_ptr
#include <functional> // function, reference_wrapper
#include <typeindex>
-#include <iosfwd>
+#include <ostream>
#include <cassert>
#include <utility> // 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<std::unique_ptr<target>, compare_pointer_target> target_set;
+ struct target_set: std::set<std::unique_ptr<target>, compare_pointer_target>
+ {
+ std::pair<target&, bool>
+ 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