From 8f8ab1e8f6d85748547c0d0e9987eed4f3c3e17b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 17 Apr 2015 15:08:05 +0200 Subject: Add support for target groups, use to handle obj/obja/objso object targets --- build/native.cxx | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) (limited to 'build/native.cxx') diff --git a/build/native.cxx b/build/native.cxx index d8b0149..42b6cf3 100644 --- a/build/native.cxx +++ b/build/native.cxx @@ -8,13 +8,48 @@ using namespace std; namespace build { + const target_type obja::static_type + { + typeid (obja), + "obja", + &file::static_type, + &member_target_factory, + file::static_type.search + }; + + const target_type objso::static_type + { + typeid (objso), + "objso", + &file::static_type, + &member_target_factory, + file::static_type.search + }; + + static target* + obj_factory (dir_path d, string n, const string* e) + { + target* a (targets.find (obja::static_type, d, n)); + target* so (targets.find (objso::static_type, d, n)); + + obj* t (new obj (move (d), move (n), e)); + + if ((t->a = static_cast (a))) + a->group = t; + + if ((t->so = static_cast (so))) + so->group = t; + + return t; + } + const target_type obj::static_type { typeid (obj), "obj", - &file::static_type, - &target_factory, - file::static_type.search + &target::static_type, + &obj_factory, + target::static_type.search }; const target_type exe::static_type -- cgit v1.1