diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-11-27 11:42:35 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-11-27 11:42:35 +0200 |
commit | 0d34b2f7692aba066213c038b810623c216b6980 (patch) | |
tree | 9c2d5db91cf075b84307957a8d9d3d10b1773a90 /build2/c | |
parent | 6324239cf260f82312143a83855eb53bdc890a70 (diff) |
Add {c,cxx}.class variables
Compiler class describes a set of compilers that follow more or less
the same command line interface. Compilers that don't belong to any of
the existing classes are in classes of their own (say, Sun CC would be
on its own if we were to support it).
Currently defined compiler classes:
gcc gcc, clang, clang-apple, icc (on non-Windows)
msvc msvc, clang-cl, icc (Windows)
Diffstat (limited to 'build2/c')
-rw-r--r-- | build2/c/init.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/build2/c/init.cxx b/build2/c/init.cxx index e473e58..4158a09 100644 --- a/build2/c/init.cxx +++ b/build2/c/init.cxx @@ -21,6 +21,7 @@ namespace build2 namespace c { using cc::compiler_id; + using cc::compiler_class; using cc::compiler_info; class config_module: public cc::config_module @@ -43,9 +44,9 @@ namespace build2 { strings r; - switch (ci.id.value ()) + switch (ci.class_) { - case compiler_id::msvc: + case compiler_class::msvc: { // Standard-wise, with VC you get what you get. The question is // whether we should verify that the requested standard is provided @@ -79,9 +80,7 @@ namespace build2 } break; } - case compiler_id::gcc: - case compiler_id::clang: - case compiler_id::icc: + case compiler_class::gcc: { // 90 and 89 are the same standard. Translate 99 to 9x and 11 to 1x // for compatibility with older versions of the compilers. @@ -188,6 +187,8 @@ namespace build2 v.insert<string> ("c.id.type"), v.insert<string> ("c.id.variant"), + v.insert<string> ("c.class"), + v.insert<string> ("c.version"), v.insert<uint64_t> ("c.version.major"), v.insert<uint64_t> ("c.version.minor"), @@ -287,7 +288,7 @@ namespace build2 "c.uninstall", cm.ci.id.value (), - cm.ci.id.variant, + cm.ci.class_, cm.ci.version.major, cm.ci.version.minor, cast<process_path> (rs[cm.x_path]), |