From 88f0780e34116c0441a8d8c58b8a8fd9fde4b1f5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 25 Jan 2017 15:41:44 +0200 Subject: Add model mutex, make var_pool const by default --- build2/install/utility | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'build2/install/utility') diff --git a/build2/install/utility b/build2/install/utility index 713c3e8..239447e 100644 --- a/build2/install/utility +++ b/build2/install/utility @@ -17,9 +17,12 @@ namespace build2 // Set install path, mode for a target type. // inline void - install_path (const target_type& tt, scope& s, dir_path d) + install_path (scope& s, const target_type& tt, dir_path d) { - auto r (s.target_vars[tt]["*"].insert ("install")); + auto r ( + s.target_vars[tt]["*"].insert ( + var_pool.rw (s).insert ("install"))); + if (r.second) // Already set by the user? r.first.get () = path_cast (move (d)); } @@ -28,13 +31,16 @@ namespace build2 inline void install_path (scope& s, dir_path d) { - return install_path (T::static_type, s, move (d)); + return install_path (s, T::static_type, move (d)); } inline void - install_mode (const target_type& tt, scope& s, string m) + install_mode (scope& s, const target_type& tt, string m) { - auto r (s.target_vars[tt]["*"].insert ("install.mode")); + auto r ( + s.target_vars[tt]["*"].insert ( + var_pool.rw (s).insert ("install.mode"))); + if (r.second) // Already set by the user? r.first.get () = move (m); } @@ -43,7 +49,7 @@ namespace build2 inline void install_mode (scope& s, string m) { - return install_mode (T::static_type, s, move (m)); + return install_mode (s, T::static_type, move (m)); } } } -- cgit v1.1