From: DarkShadow44 Date: Thu, 23 Nov 2023 20:26:31 +0000 (+0100) Subject: fix: Detect symlink called clang-cl as clang-cl (#1348) X-Git-Tag: v4.9~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e0e25d15d7046814569908ebeed635399e4f0ed;p=thirdparty%2Fccache.git fix: Detect symlink called clang-cl as clang-cl (#1348) Fixes #1347. --- diff --git a/src/ccache.cpp b/src/ccache.cpp index 7d414f316..3a59aaf21 100644 --- a/src/ccache.cpp +++ b/src/ccache.cpp @@ -249,6 +249,8 @@ CompilerType guess_compiler(std::string_view path) { std::string compiler_path(path); + const auto name_original = + util::to_lowercase(Util::remove_extension(Util::base_name(compiler_path))); #ifndef _WIN32 // Follow symlinks to the real compiler to learn its name. We're not using @@ -270,7 +272,8 @@ guess_compiler(std::string_view path) const auto name = util::to_lowercase(Util::remove_extension(Util::base_name(compiler_path))); - if (name.find("clang-cl") != std::string_view::npos) { + if (name.find("clang-cl") != std::string_view::npos + || name_original.find("clang-cl") != std::string_view::npos) { return CompilerType::clang_cl; } else if (name.find("clang") != std::string_view::npos) { return CompilerType::clang;