summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/cmake.lua
diff options
context:
space:
mode:
authorstar9029 <[email protected]>2024-12-02 17:33:34 +0800
committerstar9029 <[email protected]>2024-12-02 17:33:34 +0800
commit42934990cefe25d78a98e4314a56f9c8b9b6f281 (patch)
tree099699221f2bf52886fc5816c1f7b677dc76bac1 /xmake/modules/package/tools/cmake.lua
parent71a5624d37cdfaaba039a874e67341ee354357b7 (diff)
Use ccache when debug cmake package
Diffstat (limited to 'xmake/modules/package/tools/cmake.lua')
-rw-r--r--xmake/modules/package/tools/cmake.lua7
1 files changed, 7 insertions, 0 deletions
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