From 71d9aedda0919fb22e39d6e6ce60506ceb69812e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 25 May 2017 11:32:01 +0200 Subject: Add compiler_id enum --- build2/cc/guess.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'build2/cc/guess.cxx') diff --git a/build2/cc/guess.cxx b/build2/cc/guess.cxx index 0569bdc..9f14661 100644 --- a/build2/cc/guess.cxx +++ b/build2/cc/guess.cxx @@ -14,6 +14,18 @@ namespace build2 { namespace cc { + auto compiler_id:: + value () const -> value_type + { + if (type == "gcc") return gcc; + if (type == "clang") return clang; + if (type == "msvc") return msvc; + if (type == "icc") return icc; + + assert (false); + return gcc; + } + // Pre-guess the compiler type based on the compiler executable name. // Return empty string if can't make a guess (for example, because the // compiler name is a generic 'c++'). Note that it only guesses the type, -- cgit v1.1