From 466099ec20e9e3ddf0c10bb1d272b399a8b6e000 Mon Sep 17 00:00:00 2001 From: Konstantin Zhuravlyov Date: Wed, 31 Jul 2019 13:26:20 -0400 Subject: [PATCH] Allow ccache enabled builds if -DROCM_CCACHE_BUILD=ON Change-Id: Ie3ebb5d95af5fa55f11c9c88378ab29736538e25 [ROCm/ROCR-Runtime commit: 7d8205548b4386b13d6af9da74440e1fbc279179] --- .../rocr-runtime/runtime/hsa-runtime/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt b/projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt index 56ca824dd6..2c8eea7007 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt +++ b/projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt @@ -51,6 +51,17 @@ set ( CORE_RUNTIME_TARGET "${CORE_RUNTIME_NAME}64" ) set ( CORE_RUNTIME_LIBRARY "lib${CORE_RUNTIME_TARGET}" ) project( ${CORE_RUNTIME_TARGET} ) +# Optionally, build HSA Runtime with ccache. +set(ROCM_CCACHE_BUILD OFF CACHE BOOL "Set to ON for a ccache enabled build") +if (ROCM_CCACHE_BUILD) + find_program(CCACHE_PROGRAM ccache) + if (CCACHE_PROGRAM) + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_PROGRAM}) + else() + message(WARNING "Unable to find ccache. Falling back to real compiler") + endif() # if (CCACHE_PROGRAM) +endif() # if (ROCM_CCACHE_BUILD) + list ( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules" ) include ( utils ) include ( hsa_common )