File tree 1 file changed +12
-0
lines changed 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ option(BUILD_SHARED_LIBS "build shared libraries"
47
47
option (LLAMA_STATIC "llama: static link libraries" OFF )
48
48
option (LLAMA_NATIVE "llama: enable -march=native flag" ON )
49
49
option (LLAMA_LTO "llama: enable link time optimization" OFF )
50
+ option (LLAMA_CCACHE "llama: use ccache if available" ON )
50
51
51
52
# debug
52
53
option (LLAMA_ALL_WARNINGS "llama: enable all compiler warnings" ON )
@@ -561,6 +562,17 @@ if (LLAMA_LTO)
561
562
endif ()
562
563
endif ()
563
564
565
+ if (LLAMA_CCACHE)
566
+ find_program (LLAMA_CCACHE_FOUND ccache)
567
+ if (LLAMA_CCACHE_FOUND)
568
+ set_property (GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
569
+ set (ENV{CCACHE_SLOPPINESS} time_macros)
570
+ message (STATUS "Using ccache" )
571
+ else ()
572
+ message (STATUS "Warning: ccache not found - consider installing it or use LLAMA_CCACHE=OFF" )
573
+ endif ()
574
+ endif ()
575
+
564
576
# this version of Apple ld64 is buggy
565
577
execute_process (
566
578
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_EXE_LINKER_FLAGS} -Wl,-v
You can’t perform that action at this time.
0 commit comments