From f53a7875a9d2760263f773c0fdb7ecfb4c52c079 Mon Sep 17 00:00:00 2001 From: Konstantin Zhuravlyov Date: Wed, 31 Jul 2019 14:18:27 -0400 Subject: [PATCH] Allow ccache enabled builds if -DROCM_CCACHE_BUILD=ON Change-Id: Ia80965feb6e4ff22d466f1ff3142fb2ef303f99c [ROCm/ROCR-Runtime commit: 53e4eca48581800d137857f1fb5db38217ccca65] --- projects/rocr-runtime/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/projects/rocr-runtime/CMakeLists.txt b/projects/rocr-runtime/CMakeLists.txt index e020132ac1..f75e55d142 100644 --- a/projects/rocr-runtime/CMakeLists.txt +++ b/projects/rocr-runtime/CMakeLists.txt @@ -32,6 +32,17 @@ set ( HSAKMT_TARGET "${HSAKMT}" ) project ( ${HSAKMT_TARGET} VERSION 1.9.0) +# Optionally, build HSAKMT 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) + ## Set default module path if not already set if ( NOT DEFINED CMAKE_MODULE_PATH ) set ( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/" )