aboutsummaryrefslogtreecommitdiff
path: root/build2/cxx/utility.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-05-20 23:25:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-06-11 19:06:40 +0200
commit4218bfe7668d55e36814d6bdcec2da40454025c1 (patch)
tree1abe3f38109ba83755adf7307414dbbd1e1a9eb8 /build2/cxx/utility.ixx
parent9f56941794837ec63b8732d8d0cae4659528e714 (diff)
Initial VC++ support (static libraries only)
Diffstat (limited to 'build2/cxx/utility.ixx')
-rw-r--r--build2/cxx/utility.ixx33
1 files changed, 33 insertions, 0 deletions
diff --git a/build2/cxx/utility.ixx b/build2/cxx/utility.ixx
new file mode 100644
index 0000000..c624e87
--- /dev/null
+++ b/build2/cxx/utility.ixx
@@ -0,0 +1,33 @@
+// file : build2/cxx/utility.ixx -*- C++ -*-
+// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+namespace build2
+{
+ namespace cxx
+ {
+ bool
+ translate_std (scope&, const string&, const value&, string&);
+
+ template <typename T>
+ inline void
+ append_std (cstrings& args, scope& rs, const string& cid, T& t, string& s)
+ {
+ if (auto l = t["cxx.std"])
+ if (translate_std (rs, cid, *l, s))
+ args.push_back (s.c_str ());
+ }
+
+ template <typename T>
+ inline void
+ hash_std (sha256& csum, scope& rs, const string& cid, T& t)
+ {
+ if (auto l = t["cxx.std"])
+ {
+ string s;
+ if (translate_std (rs, cid, *l, s))
+ csum.append (s);
+ }
+ }
+ }
+}