From 53f02bf28dae507a51515ed6ac03226d68816494 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 2 Feb 2017 10:20:50 +0200 Subject: Store extension in target map key rather than in target This is in preparation for locking its modification/access. --- build2/bin/target.cxx | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'build2/bin') diff --git a/build2/bin/target.cxx b/build2/bin/target.cxx index e9ef81e..ba15c7d 100644 --- a/build2/bin/target.cxx +++ b/build2/bin/target.cxx @@ -12,7 +12,7 @@ namespace build2 { extern const char ext_var[] = "extension"; // VC14 rejects constexpr. - static target* + static pair> obje_factory (const target_type&, dir_path dir, dir_path out, @@ -20,12 +20,12 @@ namespace build2 optional ext) { obj* o (targets.find (dir, out, n)); - obje* e (new obje (move (dir), move (out), move (n), move (ext))); + obje* e (new obje (move (dir), move (out), move (n))); if ((e->group = o)) o->e = e; - return e; + return make_pair (e, move (ext)); } const target_type obje::static_type @@ -39,7 +39,7 @@ namespace build2 false }; - static target* + static pair> obja_factory (const target_type&, dir_path dir, dir_path out, @@ -47,12 +47,12 @@ namespace build2 optional ext) { obj* o (targets.find (dir, out, n)); - obja* a (new obja (move (dir), move (out), move (n), move (ext))); + obja* a (new obja (move (dir), move (out), move (n))); if ((a->group = o)) o->a = a; - return a; + return make_pair (a, move (ext)); } const target_type obja::static_type @@ -66,7 +66,7 @@ namespace build2 false }; - static target* + static pair> objs_factory (const target_type&, dir_path dir, dir_path out, @@ -74,12 +74,12 @@ namespace build2 optional ext) { obj* o (targets.find (dir, out, n)); - objs* s (new objs (move (dir), move (out), move (n), move (ext))); + objs* s (new objs (move (dir), move (out), move (n))); if ((s->group = o)) o->s = s; - return s; + return make_pair (s, move (ext)); } const target_type objs::static_type @@ -93,7 +93,7 @@ namespace build2 false }; - static target* + static pair> obj_factory (const target_type&, dir_path dir, dir_path out, @@ -104,7 +104,7 @@ namespace build2 obja* a (targets.find (dir, out, n)); objs* s (targets.find (dir, out, n)); - obj* o (new obj (move (dir), move (out), move (n), move (ext))); + obj* o (new obj (move (dir), move (out), move (n))); if ((o->e = e)) e->group = o; @@ -115,7 +115,7 @@ namespace build2 if ((o->s = s)) s->group = o; - return o; + return make_pair (o, move (ext)); } const target_type obj::static_type @@ -129,7 +129,7 @@ namespace build2 false }; - static target* + static pair> liba_factory (const target_type& t, dir_path d, dir_path o, @@ -139,12 +139,12 @@ namespace build2 // Only link-up to the group if the types match exactly. // lib* l (t == liba::static_type ? targets.find (d, o, n) : nullptr); - liba* a (new liba (move (d), move (o), move (n), move (ext))); + liba* a (new liba (move (d), move (o), move (n))); if ((a->group = l)) l->a = a; - return a; + return make_pair (a, move (ext)); } // @@ @@ -170,7 +170,7 @@ namespace build2 false }; - static target* + static pair> libs_factory (const target_type& t, dir_path d, dir_path o, @@ -180,12 +180,12 @@ namespace build2 // Only link-up to the group if the types match exactly. // lib* l (t == libs::static_type ? targets.find (d, o, n) : nullptr); - libs* s (new libs (move (d), move (o), move (n), move (ext))); + libs* s (new libs (move (d), move (o), move (n))); if ((s->group = l)) l->s = s; - return s; + return make_pair (s, move (ext)); } const target_type libs::static_type @@ -210,7 +210,7 @@ namespace build2 // members to implement "library meta-information protocol". } - static target* + static pair> lib_factory (const target_type&, dir_path d, dir_path o, @@ -220,7 +220,7 @@ namespace build2 liba* a (targets.find (d, o, n)); libs* s (targets.find (d, o, n)); - lib* l (new lib (move (d), move (o), move (n), move (ext))); + lib* l (new lib (move (d), move (o), move (n))); if ((l->a = a)) a->group = l; @@ -228,7 +228,7 @@ namespace build2 if ((l->s = s)) s->group = l; - return l; + return make_pair (l, move (ext)); } const target_type lib::static_type -- cgit v1.1