From 893a0c3130e1d868c939db6dcde258da1277cf41 Mon Sep 17 00:00:00 2001 From: Guillaume Solignac Date: Wed, 11 Jan 2023 11:56:29 +0100 Subject: build: use CMAKE_C_COMPILER_LAUNCHER for ccache In some situations, CMake will find ccache in /usr/bin but /usr/bin might not present in PATH. The former fix for this was to place the ccache configuration logic before the project() declaration, but since CMake 3.4 there is a new variable to be used which handles this case. For the original problem, see also https://crascit.com/2016/04/09/using-ccache-with-cmake/ Type: fix Signed-off-by: Guillaume Solignac Change-Id: Ie026e02b2b06e2dca2d62da5fea7b1a104bcc7c3 --- src/cmake/ccache.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmake/ccache.cmake b/src/cmake/ccache.cmake index 058a0f3d85a..a7b395bc6f9 100644 --- a/src/cmake/ccache.cmake +++ b/src/cmake/ccache.cmake @@ -20,8 +20,8 @@ if(VPP_USE_CCACHE) message(STATUS "Looking for ccache") if(CCACHE_FOUND) message(STATUS "Looking for ccache - found") - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) + set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_FOUND}) + set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_FOUND}) else(CCACHE_FOUND) message(STATUS "Looking for ccache - not found") endif(CCACHE_FOUND) -- cgit 1.2.3-korg