From 48e2e4140b8e5aacdfd107a1215f21c9632c81c8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 22 Aug 2016 12:55:21 +0200 Subject: Cache process_path, use fallback search directory for binutils --- build2/variable.ixx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'build2/variable.ixx') diff --git a/build2/variable.ixx b/build2/variable.ixx index 4b699a6..393a796 100644 --- a/build2/variable.ixx +++ b/build2/variable.ixx @@ -476,6 +476,35 @@ namespace build2 return l.compare (r); } + // process_path value + // + inline void value_traits:: + assign (value& v, process_path&& x) + { + // Convert the value to its "self-sufficient" form. + // + if (x.recall.empty ()) + x.recall = path (x.initial); + + x.initial = x.recall.string ().c_str (); + + if (v) + v.as () = move (x); + else + new (&v.data_) process_path (move (x)); + } + + inline int value_traits:: + compare (const process_path& x, const process_path& y) + { + int r (x.recall.compare (y.recall)); + + if (r == 0) + r = x.effect.compare (y.effect); + + return r; + } + // vector value // template -- cgit v1.1