From 42934990cefe25d78a98e4314a56f9c8b9b6f281 Mon Sep 17 00:00:00 2001 From: star9029 Date: Mon, 2 Dec 2024 17:33:34 +0800 Subject: Use ccache when debug cmake package --- xmake/modules/package/tools/cmake.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'xmake/modules/package') diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua index b0bc9f34d..6d7f15dce 100644 --- a/xmake/modules/package/tools/cmake.lua +++ b/xmake/modules/package/tools/cmake.lua @@ -952,6 +952,13 @@ function _get_configs(package, configs, opt) end end _insert_configs_from_envs(configs, envs or {}, opt) + + local ccache = package:data("ccache") + if ccache then + table.insert(configs, "-DCMAKE_C_COMPILER_LAUNCHER=" .. ccache) + table.insert(configs, "-DCMAKE_CXX_COMPILER_LAUNCHER=" .. ccache) + end + return configs end -- cgit v1.3.1