From: Joel Rosdahl Date: Sun, 23 Jan 2022 19:27:03 +0000 (+0100) Subject: feat: Detect MSVC compiler case insensitive and with exact match X-Git-Tag: v4.6~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2e9eea78fe2077da7b3b6628a0b8763ec57e61e;p=thirdparty%2Fccache.git feat: Detect MSVC compiler case insensitive and with exact match --- diff --git a/src/ccache.cpp b/src/ccache.cpp index 3a8a89d71..51da46b66 100644 --- a/src/ccache.cpp +++ b/src/ccache.cpp @@ -227,7 +227,8 @@ guess_compiler(string_view path) } #endif - const string_view name = Util::base_name(compiler_path); + const auto name = + Util::to_lowercase(Util::remove_extension(Util::base_name(compiler_path))); if (name.find("clang") != nonstd::string_view::npos) { return CompilerType::clang; } else if (name.find("gcc") != nonstd::string_view::npos @@ -235,7 +236,7 @@ guess_compiler(string_view path) return CompilerType::gcc; } else if (name.find("nvcc") != nonstd::string_view::npos) { return CompilerType::nvcc; - } else if (name.find("cl") != nonstd::string_view::npos) { + } else if (name == "cl") { return CompilerType::msvc; } else { return CompilerType::other;