2019-04-06 21:08:09 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2017-10-27 21:43:34 +08:00
|
|
|
# Use ccache if it is installed, unless the user explicitly disables
|
|
|
|
# it by setting USE_CCACHE=0.
|
|
|
|
|
2021-12-17 00:13:54 +08:00
|
|
|
include_guard(GLOBAL)
|
|
|
|
|
2017-10-27 21:43:34 +08:00
|
|
|
if(USE_CCACHE STREQUAL "0")
|
|
|
|
else()
|
|
|
|
find_program(CCACHE_FOUND ccache)
|
|
|
|
if(CCACHE_FOUND)
|
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
|
|
|
endif()
|
|
|
|
endif()
|