]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
feat: Add support for Intel's LLVM-based compilers (#1533)
authorNick Sarnie <nick.sarnie@intel.com>
Wed, 1 Jan 2025 12:50:39 +0000 (21:50 +0900)
committerGitHub <noreply@github.com>
Wed, 1 Jan 2025 12:50:39 +0000 (13:50 +0100)
doc/MANUAL.adoc
src/ccache/ccache.cpp
src/ccache/config.cpp
src/ccache/config.hpp

index 0b8e5ac4efc22a896df5e9767dca47a36b3131f0..76b3880799818397af5ba082efc1bcd39c3269f8 100644 (file)
@@ -612,6 +612,10 @@ _<<Using ccache with other compiler wrappers>>_.
     GCC-based compiler.
 *icl*::
     Intel compiler on Windows.
+*icx*::
+    Intel LLVM-based compiler.
+*icx-cl*::
+    Intel LLVM-based MSVC-compatible compiler on Windows.
 *msvc*::
     Microsoft Visual C++ (MSVC).
 *nvcc*::
index 7954bcf876d5aade0f904f0871ff8ca2ed9a16ea..465b85e1dc4f70d70644079dc59e01c57736f5b9 100644 (file)
@@ -325,6 +325,10 @@ do_guess_compiler(const fs::path& path)
     return CompilerType::nvcc;
   } else if (name == "icl") {
     return CompilerType::icl;
+  } else if (name == "icx") {
+    return CompilerType::icx;
+  } else if (name == "icx-cl") {
+    return CompilerType::icx_cl;
   } else if (name == "cl") {
     return CompilerType::msvc;
   } else {
index 6157d996d7dd6c90826dd0c9aa28b75b5c6b921a..f0f9b0e3d324add237303c9fa15c69249c13d974 100644 (file)
@@ -290,6 +290,10 @@ parse_compiler_type(const std::string& value)
     return CompilerType::gcc;
   } else if (value == "icl") {
     return CompilerType::icl;
+  } else if (value == "icx") {
+    return CompilerType::icx;
+  } else if (value == "icx-cl") {
+    return CompilerType::icx_cl;
   } else if (value == "msvc") {
     return CompilerType::msvc;
   } else if (value == "nvcc") {
@@ -571,10 +575,13 @@ compiler_type_to_string(CompilerType compiler_type)
     return "auto";
   case CompilerType::clang_cl:
     return "clang-cl";
+  case CompilerType::icx_cl:
+    return "icx-cl";
 
     CASE(clang);
     CASE(gcc);
     CASE(icl);
+    CASE(icx);
     CASE(msvc);
     CASE(nvcc);
     CASE(other);
index 2e15b4c04399263cddf93a14c2f7d78603fda9d0..659f2cc335f1a6df463afd6663e87b070b790d1c 100644 (file)
@@ -40,6 +40,8 @@ enum class CompilerType {
   clang_cl,
   gcc,
   icl,
+  icx,
+  icx_cl,
   msvc,
   nvcc,
   other
@@ -100,10 +102,10 @@ public:
   const std::filesystem::path& temporary_dir() const;
   std::optional<mode_t> umask() const;
 
-  // Return true for Clang and clang-cl.
+  // Return true for Clang, clang-cl and icx (not on Windows).
   bool is_compiler_group_clang() const;
 
-  // Return true for MSVC (cl.exe), clang-cl, and icl.
+  // Return true for MSVC (cl.exe), clang-cl, icl, icx-cl, and icx (on Windows).
   bool is_compiler_group_msvc() const;
 
   util::SizeUnitPrefixType size_unit_prefix_type() const;
@@ -286,6 +288,9 @@ inline bool
 Config::is_compiler_group_clang() const
 {
   return m_compiler_type == CompilerType::clang
+#ifndef _WIN32
+         || m_compiler_type == CompilerType::icx
+#endif
          || m_compiler_type == CompilerType::clang_cl;
 }
 
@@ -294,7 +299,11 @@ Config::is_compiler_group_msvc() const
 {
   return m_compiler_type == CompilerType::msvc
          || m_compiler_type == CompilerType::clang_cl
-         || m_compiler_type == CompilerType::icl;
+         || m_compiler_type == CompilerType::icl
+#ifdef _WIN32
+         || m_compiler_type == CompilerType::icx
+#endif
+         || m_compiler_type == CompilerType::icx_cl;
 }
 
 inline bool