Set RULE_LAUNCH_COMPILE to detected ccache absolute path.

This should fix a build issue on systems that install ccache to /usr/local/ or
/opt/homebrew/ and don't include that path in non-interactive shells
spawned by subprocesses.
This commit is contained in:
S David 2024-05-25 09:51:12 -04:00
parent 9588f196b1
commit f5a3bbbdda

View file

@ -947,9 +947,9 @@ if (LLAMA_LTO)
endif() endif()
if (LLAMA_CCACHE) if (LLAMA_CCACHE)
find_program(LLAMA_CCACHE_FOUND ccache) find_program(LLAMA_CCACHE_PATH ccache)
if (LLAMA_CCACHE_FOUND) if (LLAMA_CCACHE_PATH)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${LLAMA_CCACHE_PATH})
set(ENV{CCACHE_SLOPPINESS} time_macros) set(ENV{CCACHE_SLOPPINESS} time_macros)
message(STATUS "ccache found, compilation results will be cached. Disable with LLAMA_CCACHE=OFF.") message(STATUS "ccache found, compilation results will be cached. Disable with LLAMA_CCACHE=OFF.")
else() else()