From 9fb791e9fad6c63fc1dac49f4d05ae63b8a3db9b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 5 Jan 2016 11:55:15 +0200 Subject: Rename build directory/namespace to build2 --- build2/cxx/utility.txx | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 build2/cxx/utility.txx (limited to 'build2/cxx/utility.txx') diff --git a/build2/cxx/utility.txx b/build2/cxx/utility.txx new file mode 100644 index 0000000..b35649e --- /dev/null +++ b/build2/cxx/utility.txx @@ -0,0 +1,35 @@ +// file : build2/cxx/utility.txx -*- C++ -*- +// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +using namespace std; + +namespace build2 +{ + namespace cxx + { + template + void + append_std (cstrings& args, T& t, std::string& s) + { + if (auto l = t["cxx.std"]) + { + const std::string& v (as (*l)); + + // 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