From 0d34b2f7692aba066213c038b810623c216b6980 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 27 Nov 2017 11:42:35 +0200 Subject: 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) --- build2/c/init.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'build2/c') 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 ("c.id.type"), v.insert ("c.id.variant"), + v.insert ("c.class"), + v.insert ("c.version"), v.insert ("c.version.major"), v.insert ("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 (rs[cm.x_path]), -- cgit v1.1