mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 10:05:32 +00:00
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.
This commit is contained in:
parent
10d40af167
commit
483c18437b
|
@ -2,8 +2,17 @@
|
|||
# ccache setup
|
||||
#
|
||||
|
||||
list(APPEND COMPILERS
|
||||
"CMAKE_C_COMPILER"
|
||||
"CMAKE_CXX_COMPILER"
|
||||
)
|
||||
find_program(CCACHE_PROGRAM ccache)
|
||||
if(CCACHE_PROGRAM)
|
||||
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}" CACHE FILEPATH "Path to a compiler launcher program, e.g. ccache")
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}" CACHE FILEPATH "Path to a compiler launcher program, e.g. ccache")
|
||||
endif()
|
||||
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()
|
||||
|
|
Loading…
Reference in a new issue