aboutsummaryrefslogtreecommitdiff
path: root/build/target
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-07-07 09:18:22 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-07-07 09:18:22 +0200
commit49d5628e35593a5300d39596286c768d7aa435b6 (patch)
tree43f20983a381c54aac7536e78e4f9543d8761aac /build/target
parent16c19b739a58845af7f807c3dee8021a1c421006 (diff)
Rework module architecture
Now the target type and rule maps are in scopes (builtins -- in global scope). We also now have the map of loaded modules in the root scope of each project.
Diffstat (limited to 'build/target')
-rw-r--r--build/target30
1 files changed, 3 insertions, 27 deletions
diff --git a/build/target b/build/target
index 4131338..954604c 100644
--- a/build/target
+++ b/build/target
@@ -10,19 +10,20 @@
#include <vector>
#include <memory> // unique_ptr
#include <cstddef> // size_t
-#include <functional> // function, reference_wrapper
+#include <functional> // reference_wrapper
#include <ostream>
#include <cassert>
#include <utility> // move(), forward(), declval()
#include <iterator>
#include <type_traits>
-#include <butl/utility> // compare_c_string, reverse_iterate()
+#include <butl/utility> // reverse_iterate()
#include <butl/multi-index> // map_iterator_adapter
#include <build/types>
#include <build/variable>
#include <build/operation>
+#include <build/target-type>
#include <build/target-key>
#include <build/prerequisite>
@@ -756,31 +757,6 @@ namespace build
extern target_set targets;
- using target_type_map_base = std::map<
- const char*,
- std::reference_wrapper<const target_type>,
- butl::compare_c_string>;
-
- class target_type_map: public target_type_map_base
- {
- public:
- void
- insert (const target_type& tt) {emplace (tt.name, tt);}
-
- using target_type_map_base::find;
-
- // Given a name, figure out its type, taking into account extensions,
- // special names (e.g., '.' and '..'), or anything else that might be
- // relevant. Also process the name (in place) by extracting the
- // extension, adjusting dir/value, etc (note that the dir is not
- // necessarily normalized). Return NULL if not found.
- //
- const target_type*
- find (name&, const std::string*& ext) const;
- };
-
- extern target_type_map target_types;
-
// Modification time-based target.
//
class mtime_target: public target