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/cc/guess.hxx | |
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/cc/guess.hxx')
-rw-r--r-- | build2/cc/guess.hxx | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/build2/cc/guess.hxx b/build2/cc/guess.hxx index 4d5d036..2eaa9d7 100644 --- a/build2/cc/guess.hxx +++ b/build2/cc/guess.hxx @@ -37,12 +37,11 @@ namespace build2 std::string string () const {return variant.empty () ? type : type + "-" + variant;} - // Note: does not include variant. - // enum value_type { gcc, clang, + clang_apple, msvc, icc }; @@ -57,6 +56,31 @@ namespace build2 return os << id.string (); } + // 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) + // + enum class compiler_class + { + gcc, + msvc + }; + + string + to_string (compiler_class); + + inline ostream& + operator<< (ostream& os, compiler_class cl) + { + return os << to_string (cl); + } + // Compiler version. Here we map the various compiler version formats to // something that resembles the MAJOR.MINOR.PATCH-BUILD form of the // Semantic Versioning. While the MAJOR.MINOR part is relatively @@ -122,6 +146,7 @@ namespace build2 { process_path path; compiler_id id; + compiler_class class_; compiler_version version; string signature; string checksum; |