summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/cmake.lua
diff options
context:
space:
mode:
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