[llvm] ffbd6ba - [CMake] Fix the check for Windows vs ccache (#137238)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 25 00:48:15 PDT 2025


Author: Martin Storsjö
Date: 2025-04-25T10:48:12+03:00
New Revision: ffbd6bae3e961c2a6d23022e8153f44a33e09bf4

URL: https://github.com/llvm/llvm-project/commit/ffbd6bae3e961c2a6d23022e8153f44a33e09bf4
DIFF: https://github.com/llvm/llvm-project/commit/ffbd6bae3e961c2a6d23022e8153f44a33e09bf4.diff

LOG: [CMake] Fix the check for Windows vs ccache (#137238)

Only the host OS matters for how to interact with ccache, not the target
OS that we may be cross compiling for.

This mistake seems to have been present all since support for ccache on
Windows was added in
a4425cc9146059618b3b7e927639b60a7c3301bc.

Added: 
    

Modified: 
    llvm/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index d47ac3ccffd05..c690acc27fa74 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -276,7 +276,7 @@ if(LLVM_CCACHE_BUILD)
     set(LLVM_CCACHE_PARAMS "CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines,time_macros"
         CACHE STRING "Parameters to pass through to ccache")
 
-    if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
+    if(NOT CMAKE_HOST_WIN32)
       set(CCACHE_PROGRAM "${LLVM_CCACHE_PARAMS} ${CCACHE_PROGRAM}")
       if (LLVM_CCACHE_MAXSIZE)
         set(CCACHE_PROGRAM "CCACHE_MAXSIZE=${LLVM_CCACHE_MAXSIZE} ${CCACHE_PROGRAM}")


        


More information about the llvm-commits mailing list