diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-10-11 07:52:51 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-10-11 08:45:57 +0200 |
commit | 2fb22e7b4aedcb62bb3a4d868c311237f3537a2f (patch) | |
tree | 64f0ca37c91a78091f0daa3a53eded8f7996e867 /libbuild2/cc/module.cxx | |
parent | cc57f3a59ed7e19d663ed77654de2a5e16e16875 (diff) |
Add support for clang-cl
The compiler type is `msvc`, variant `clang`.
Diffstat (limited to 'libbuild2/cc/module.cxx')
-rw-r--r-- | libbuild2/cc/module.cxx | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/libbuild2/cc/module.cxx b/libbuild2/cc/module.cxx index f3ce32b..641da5e 100644 --- a/libbuild2/cc/module.cxx +++ b/libbuild2/cc/module.cxx @@ -173,11 +173,19 @@ namespace build2 rs.assign (x_class) = to_string (xi.class_); - rs.assign (x_version) = xi.version.string; - rs.assign (x_version_major) = xi.version.major; - rs.assign (x_version_minor) = xi.version.minor; - rs.assign (x_version_patch) = xi.version.patch; - rs.assign (x_version_build) = xi.version.build; + auto assign_version = [&rs] (const variable** vars, + const compiler_version* v) + { + rs.assign (vars[0]) = v != nullptr ? value (v->string) : value (); + rs.assign (vars[1]) = v != nullptr ? value (v->major) : value (); + rs.assign (vars[2]) = v != nullptr ? value (v->minor) : value (); + rs.assign (vars[3]) = v != nullptr ? value (v->patch) : value (); + rs.assign (vars[4]) = v != nullptr ? value (v->build) : value (); + }; + + assign_version (&x_version, &xi.version); + assign_version (&x_variant_version, + xi.variant_version ? &*xi.variant_version : nullptr); // Also enter as x.target.{cpu,vendor,system,version,class} for // convenience of access. @@ -452,6 +460,20 @@ namespace build2 dr << " build " << xi.version.build << '\n'; } + if (xi.variant_version) + { + dr << " variant: " << '\n' + << " version " << xi.variant_version->string << '\n' + << " major " << xi.variant_version->major << '\n' + << " minor " << xi.variant_version->minor << '\n' + << " patch " << xi.variant_version->patch << '\n'; + } + + if (xi.variant_version && !xi.variant_version->build.empty ()) + { + dr << " build " << xi.variant_version->build << '\n'; + } + { const string& ct (tt.string ()); // Canonical target. |