summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools
diff options
context:
space:
mode:
authorruki <[email protected]>2024-12-03 10:15:52 +0800
committerGitHub <[email protected]>2024-12-03 10:15:52 +0800
commitfcabe5855eed5daa8e134e91da17c6acf40f5db0 (patch)
treea0652f175c45d35af2a77297ffa28cda0fa2bf54 /xmake/modules/package/tools
parent46ec7f87125cd7824c9ad7b1256693b575f0c576 (diff)
parentd9bc6250c4cab08285cbeab73293886527098f14 (diff)
Merge pull request #5919 from star-hengxing/ccache
Use ccache when debug cmake package
Diffstat (limited to 'xmake/modules/package/tools')
-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