From b4286df8c9bafdab1934cef99ccc0506ec4555e2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 20 Jul 2018 14:46:58 +0200 Subject: Add builtin.concat(dir_path,name) overload In particular, this allows: export $out_root/libfoo/$import.target --- build2/functions-name.cxx | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 build2/functions-name.cxx (limited to 'build2/functions-name.cxx') diff --git a/build2/functions-name.cxx b/build2/functions-name.cxx new file mode 100644 index 0000000..1bdff11 --- /dev/null +++ b/build2/functions-name.cxx @@ -0,0 +1,28 @@ +// file : build2/functions-name.cxx -*- C++ -*- +// copyright : Copyright (c) 2014-2018 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +#include +#include + +using namespace std; + +namespace build2 +{ + void + name_functions () + { + // function_family f ("name"); + + // Name-specific overloads from builtins. + // + function_family b ("builtin"); + + b[".concat"] = [](dir_path d, name n) + { + d /= n.dir; + n.dir = move (d); + return n; + }; + } +} -- cgit v1.1