]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix: Detect hppa2.0-unknown-linux-gnu-gcc as GCC
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 11 Apr 2026 07:09:35 +0000 (09:09 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 11 Apr 2026 07:43:50 +0000 (09:43 +0200)
Fixes #1721.

src/ccache/ccache.cpp

index 6338ae05600a16c29999b27e21171df8f4e29f16..1c03f9e55c46e6b7bd318b2f261838eafc1e6830 100644 (file)
@@ -317,8 +317,14 @@ probe_generic_compiler(const fs::path& path)
 static CompilerType
 do_guess_compiler(const fs::path& path)
 {
-  const auto name = util::to_lowercase(
-    util::pstr(util::with_extension(path.filename(), "")).str());
+  const auto filename = util::to_lowercase(util::pstr(path.filename()).str());
+  std::string_view name = filename;
+#ifdef _WIN32
+  if (name.ends_with(".exe")) {
+    name.remove_suffix(4);
+  }
+#endif
+
   if (name.find("clang-cl") != std::string_view::npos) {
     return CompilerType::clang_cl;
   } else if (name.find("clang") != std::string_view::npos) {