From: Nick Sarnie Date: Wed, 1 Jan 2025 12:50:39 +0000 (+0900) Subject: feat: Add support for Intel's LLVM-based compilers (#1533) X-Git-Tag: v4.11~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0113ebc71acacb1c22e88b228e719dfa0a47b3d;p=thirdparty%2Fccache.git feat: Add support for Intel's LLVM-based compilers (#1533) --- diff --git a/doc/MANUAL.adoc b/doc/MANUAL.adoc index 0b8e5ac4..76b38807 100644 --- a/doc/MANUAL.adoc +++ b/doc/MANUAL.adoc @@ -612,6 +612,10 @@ _<>_. 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*:: diff --git a/src/ccache/ccache.cpp b/src/ccache/ccache.cpp index 7954bcf8..465b85e1 100644 --- a/src/ccache/ccache.cpp +++ b/src/ccache/ccache.cpp @@ -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 { diff --git a/src/ccache/config.cpp b/src/ccache/config.cpp index 6157d996..f0f9b0e3 100644 --- a/src/ccache/config.cpp +++ b/src/ccache/config.cpp @@ -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); diff --git a/src/ccache/config.hpp b/src/ccache/config.hpp index 2e15b4c0..659f2cc3 100644 --- a/src/ccache/config.hpp +++ b/src/ccache/config.hpp @@ -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 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