cmake : option to disable ccache

This commit is contained in:
Georgi Gerganov 2024-01-20 10:10:42 +02:00
parent dcf8dc7292
commit 2dc7c81b61
No known key found for this signature in database
GPG key ID: 449E073F9DC10735

View file

@ -47,6 +47,7 @@ option(BUILD_SHARED_LIBS "build shared libraries"
option(LLAMA_STATIC "llama: static link libraries" OFF) option(LLAMA_STATIC "llama: static link libraries" OFF)
option(LLAMA_NATIVE "llama: enable -march=native flag" ON) option(LLAMA_NATIVE "llama: enable -march=native flag" ON)
option(LLAMA_LTO "llama: enable link time optimization" OFF) option(LLAMA_LTO "llama: enable link time optimization" OFF)
option(LLAMA_CCACHE "llama: use ccache if available" ON)
# debug # debug
option(LLAMA_ALL_WARNINGS "llama: enable all compiler warnings" ON) option(LLAMA_ALL_WARNINGS "llama: enable all compiler warnings" ON)
@ -561,10 +562,15 @@ if (LLAMA_LTO)
endif() endif()
endif() endif()
if (LLAMA_CCACHE)
find_program(LLAMA_CCACHE_FOUND ccache) find_program(LLAMA_CCACHE_FOUND ccache)
if (LLAMA_CCACHE_FOUND) if (LLAMA_CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set(ENV{CCACHE_SLOPPINESS} pch_defines,time_macros) set(ENV{CCACHE_SLOPPINESS} time_macros)
message(STATUS "Using ccache")
else()
message(STATUS "Warning: ccache not found - consider installing it or use LLAMA_CCACHE=OFF")
endif ()
endif() endif()
# this version of Apple ld64 is buggy # this version of Apple ld64 is buggy