aboutsummaryrefslogtreecommitdiff
path: root/build/cxx/utility.txx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-07-20 10:38:02 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-07-20 10:38:02 +0200
commitc1981e367aafc22389ac0ab506b00e9657c8071c (patch)
tree528b0d00283411de2daf6d0e2163f72f2e741ee9 /build/cxx/utility.txx
parent243da3993c138d33063f633aa3996a8a710ea396 (diff)
Implement support for importing installed libraries
Diffstat (limited to 'build/cxx/utility.txx')
-rw-r--r--build/cxx/utility.txx35
1 files changed, 35 insertions, 0 deletions
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 <typename T>
+ void
+ append_std (cstrings& args, T& t, std::string& s)
+ {
+ if (auto val = t["cxx.std"])
+ {
+ const std::string& v (val.template as<const string&> ());
+
+ // 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 ());
+ }
+ }
+ }
+}