Skip to content

Commit 61d4754

Browse files
committed
[CMake] Include pre-4.8 ccache error on Windows
1 parent 7d7d282 commit 61d4754

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

llvm/CMakeLists.txt

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,22 @@ if(LLVM_CCACHE_BUILD)
284284
set(LLVM_CCACHE_PARAMS "CCACHE_CPP2=yes;CCACHE_HASHDIR=yes"
285285
CACHE STRING "Parameters to pass through to ccache")
286286

287-
set(launcher_params ${LLVM_CCACHE_PARAMS})
288-
if (LLVM_CCACHE_MAXSIZE)
289-
set(launcher_params CCACHE_MAXSIZE=${LLVM_CCACHE_MAXSIZE} ${launcher_params})
290-
endif()
291-
if (LLVM_CCACHE_DIR)
292-
set(launcher_params CCACHE_DIR=${LLVM_CCACHE_DIR} ${launcher_params})
287+
if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
288+
set(launcher_params ${LLVM_CCACHE_PARAMS})
289+
if (LLVM_CCACHE_MAXSIZE)
290+
set(launcher_params CCACHE_MAXSIZE=${LLVM_CCACHE_MAXSIZE} ${launcher_params})
291+
endif()
292+
if (LLVM_CCACHE_DIR)
293+
set(launcher_params CCACHE_DIR=${LLVM_CCACHE_DIR} ${launcher_params})
294+
endif()
295+
set(launcher ${launcher_params} "${CCACHE_PROGRAM}")
296+
else()
297+
if(LLVM_CCACHE_MAXSIZE OR LLVM_CCACHE_DIR OR
298+
NOT LLVM_CCACHE_PARAMS MATCHES "CCACHE_CPP2=yes;CCACHE_HASHDIR=yes")
299+
message(FATAL_ERROR "Ccache configuration through CMake is not supported on Windows. Please use environment variables.")
300+
endif()
301+
set(launcher "${CCACHE_PROGRAM}")
293302
endif()
294-
set(launcher ${launcher_params} "${CCACHE_PROGRAM}")
295303
else()
296304
set(LLVM_CCACHE_PARAMS "run_second_cpp=true;hash_dir=true"
297305
CACHE STRING "Parameters to pass through to ccache")

0 commit comments

Comments
 (0)