1# SPDX-License-Identifier: Apache-2.0
2
3# Use ccache if it is installed, unless the user explicitly disables
4# it by setting USE_CCACHE=0.
5
6include_guard(GLOBAL)
7
8if(USE_CCACHE STREQUAL "0")
9else()
10  find_program(CCACHE_FOUND ccache)
11  if(CCACHE_FOUND)
12    set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
13    set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK    ccache)
14  endif()
15endif()
16