diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-01-06 17:28:45 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-01-06 17:28:45 +0200 |
commit | 9f5c4c1ae3bff517eefb39130287016514fb31c7 (patch) | |
tree | ce230ddff1c623a4b329c3ae74fe6e77243be068 /build2/context.cxx | |
parent | 6f1d989609ac5d13e204fab3bd85f6364e12edd5 (diff) |
Store platform targets as typed target_triplet
Diffstat (limited to 'build2/context.cxx')
-rw-r--r-- | build2/context.cxx | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/build2/context.cxx b/build2/context.cxx index f9124d4..38c726d 100644 --- a/build2/context.cxx +++ b/build2/context.cxx @@ -6,8 +6,6 @@ #include <sstream> -#include <butl/triplet> - #include <build2/rule> #include <build2/scope> #include <build2/target> @@ -283,20 +281,21 @@ namespace build2 try { - string canon; - triplet t (orig, canon); + target_triplet t (orig); - l5 ([&]{trace << "canonical host: '" << canon << "'; " + l5 ([&]{trace << "canonical host: '" << t.string () << "'; " << "class: " << t.class_;}); - // Enter as build.host.{cpu,vendor,system,version,class}. + // Also enter as build.host.{cpu,vendor,system,version,class} for + // convenience of access. // - gs.assign<string> ("build.host") = move (canon); - gs.assign<string> ("build.host.cpu") = move (t.cpu); - gs.assign<string> ("build.host.vendor") = move (t.vendor); - gs.assign<string> ("build.host.system") = move (t.system); - gs.assign<string> ("build.host.version") = move (t.version); - gs.assign<string> ("build.host.class") = move (t.class_); + gs.assign<string> ("build.host.cpu") = t.cpu; + gs.assign<string> ("build.host.vendor") = t.vendor; + gs.assign<string> ("build.host.system") = t.system; + gs.assign<string> ("build.host.version") = t.version; + gs.assign<string> ("build.host.class") = t.class_; + + gs.assign<target_triplet> ("build.host") = move (t); } catch (const invalid_argument& e) { |