diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-04-17 15:08:05 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-04-17 15:08:05 +0200 |
commit | 8f8ab1e8f6d85748547c0d0e9987eed4f3c3e17b (patch) | |
tree | 1ef9a9f271d688f1f6f2eb3fc5a8972574677433 /build/native.cxx | |
parent | 6535bf6175af32e2514faf75d2742424751a783b (diff) |
Add support for target groups, use to handle obj/obja/objso object targets
Diffstat (limited to 'build/native.cxx')
-rw-r--r-- | build/native.cxx | 41 |
1 files changed, 38 insertions, 3 deletions
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<obja, obj>, + file::static_type.search + }; + + const target_type objso::static_type + { + typeid (objso), + "objso", + &file::static_type, + &member_target_factory<objso, obj>, + 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<obja*> (a))) + a->group = t; + + if ((t->so = static_cast<objso*> (so))) + so->group = t; + + return t; + } + const target_type obj::static_type { typeid (obj), "obj", - &file::static_type, - &target_factory<obj>, - file::static_type.search + &target::static_type, + &obj_factory, + target::static_type.search }; const target_type exe::static_type |