From 4c44c914d898af53152addad5530504548175e85 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 20 Apr 2015 15:34:16 +0200 Subject: Merge config.cxx.* variables into cxx.* when loading cxx module --- build/variable.ixx | 48 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 9 deletions(-) (limited to 'build/variable.ixx') diff --git a/build/variable.ixx b/build/variable.ixx index 2cbe519..52272cc 100644 --- a/build/variable.ixx +++ b/build/variable.ixx @@ -37,27 +37,57 @@ namespace build } inline const value_proxy& value_proxy:: - operator+= (std::string v) const + operator= (dir_path v) const { - if (*p == nullptr) - *this = v; - else - as ().emplace_back (std::move (v)); + p->reset (new list_value (std::move (v))); + return *this; + } + inline const value_proxy& value_proxy:: + operator= (nullptr_t) const + { + p->reset (); return *this; } inline const value_proxy& value_proxy:: - operator= (dir_path v) const + operator+= (const value_proxy& v) const { - p->reset (new list_value (std::move (v))); + if (v && this != &v) + { + if (*p == nullptr) + *this = v; + else + //@@ Assuming it is a list_value. + // + *this += v.as (); + } + return *this; } inline const value_proxy& value_proxy:: - operator= (nullptr_t) const + operator+= (const list_value& v) const { - p->reset (); + if (*p == nullptr) + *this = value_ptr (new list_value (v)); + else + { + list_value& lv (as ()); + lv.insert (lv.end (), v.begin (), v.end ()); + } + + return *this; + } + + inline const value_proxy& value_proxy:: + operator+= (std::string v) const + { + if (*p == nullptr) + *this = v; + else + as ().emplace_back (std::move (v)); + return *this; } } -- cgit v1.1