File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -624,6 +624,9 @@ if (COMPILER_CACHE STREQUAL "chcache" AND CHCACHE_EXECUTABLE_PATH STREQUAL "")
624624 message (STATUS "Adding chcache as dependency to all other targets" )
625625 get_all_targets(all_targets)
626626 set (chcache_targets _cargo-build_chcache cargo-build_chcache cargo-prebuild_chcache)
627+ if (NOT TARGET cargo-build_chcache)
628+ message (FATAL_ERROR "Building chcache is disabled and CHCACHE_EXECUTABLE_PATH is not set, cannot use chcache as compiler cache." )
629+ endif ()
627630 foreach (target ${all_targets} )
628631 if (target IN_LIST chcache_targets)
629632 continue ()
Original file line number Diff line number Diff line change @@ -24,16 +24,16 @@ set(COMPILER_CACHE "auto" CACHE STRING "Speedup re-compilations using the cachin
2424
2525if (COMPILER_CACHE STREQUAL "auto" )
2626 find_program (CCACHE_EXECUTABLE NAMES sccache ccache)
27- elseif (COMPILER_CACHE STREQUAL "ccache" )
27+ elseif (COMPILER_CACHE STREQUAL "ccache" )
2828 find_program (CCACHE_EXECUTABLE ccache)
2929elseif (COMPILER_CACHE STREQUAL "sccache" )
3030 find_program (CCACHE_EXECUTABLE sccache)
3131elseif (COMPILER_CACHE STREQUAL "chcache" )
32- if (CHCACHE_EXECUTABLE_PATH STREQUAL "" )
33- message (STATUS "Using built chcache" )
32+ if (CHCACHE_EXECUTABLE_PATH STREQUAL "" )
33+ message (STATUS "Using self- built chcache" )
3434 set (CCACHE_EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR} /rust/chcache/chcache)
3535 else ()
36- message (STATUS "Using chcache from ${CHCACHE_EXECUTABLE_PATH} " )
36+ message (STATUS "Using already built chcache from ${CHCACHE_EXECUTABLE_PATH} " )
3737 set (CCACHE_EXECUTABLE ${CHCACHE_EXECUTABLE_PATH} )
3838 endif ()
3939elseif (COMPILER_CACHE STREQUAL "disabled" )
Original file line number Diff line number Diff line change 11add_subdirectory (workspace)
2- add_subdirectory (chcache)
2+
3+ option (ENABLE_CHCACHE "Enable chcache" ${ENABLE_RUST} )
4+
5+ if (ENABLE_CHCACHE)
6+ add_subdirectory (chcache)
7+ endif ()
You can’t perform that action at this time.
0 commit comments