ladybird/Meta/CMake/setup_ccache.cmake
Jan200101 483c18437b Meta: Detect ccache being passed as the compiler
This prevents ccache from being invoking itself.
Icecc fails to ran this way because of recursion detection.
2022-12-12 21:34:09 -07:00

19 lines
542 B
CMake

#
# ccache setup
#
list(APPEND COMPILERS
"CMAKE_C_COMPILER"
"CMAKE_CXX_COMPILER"
)
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
foreach(compiler ${COMPILERS})
get_filename_component(compiler_path "${${compiler}}" REALPATH)
get_filename_component(compiler_name "${compiler_path}" NAME)
if (NOT ${compiler_name} MATCHES "ccache")
set("${compiler}_LAUNCHER" "${CCACHE_PROGRAM}" CACHE FILEPATH "Path to a compiler launcher program, e.g. ccache")
endif()
endforeach()
endif()