From c1981e367aafc22389ac0ab506b00e9657c8071c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 20 Jul 2015 10:38:02 +0200 Subject: Implement support for importing installed libraries --- build/cxx/utility.txx | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 build/cxx/utility.txx (limited to 'build/cxx/utility.txx') diff --git a/build/cxx/utility.txx b/build/cxx/utility.txx new file mode 100644 index 0000000..7d9d686 --- /dev/null +++ b/build/cxx/utility.txx @@ -0,0 +1,35 @@ +// file : build/cxx/utility.txx -*- C++ -*- +// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +using namespace std; + +namespace build +{ + namespace cxx + { + template + void + append_std (cstrings& args, T& t, std::string& s) + { + if (auto val = t["cxx.std"]) + { + const std::string& v (val.template as ()); + + // Translate 11 to 0x and 14 to 1y for compatibility with + // older versions of the compiler. + // + s = "-std=c++"; + + if (v == "11") + s += "0x"; + else if (v == "14") + s += "1y"; + else + s += v; + + args.push_back (s.c_str ()); + } + } + } +} -- cgit v1.1