summaryrefslogtreecommitdiff
path: root/xmake/modules/private/cache/build_cache.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-01-14 23:30:52 +0800
committerruki <[email protected]>2025-01-14 23:30:52 +0800
commitc12998a152638a0e77bc2b48a7af72652202e952 (patch)
tree317fa9ac4784c1330c75c6a173e990e5f6e9c57f /xmake/modules/private/cache/build_cache.lua
parente9a835fcf31687bb2463ecafe946e75244a610b2 (diff)
improve build cache
Diffstat (limited to 'xmake/modules/private/cache/build_cache.lua')
-rw-r--r--xmake/modules/private/cache/build_cache.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/xmake/modules/private/cache/build_cache.lua b/xmake/modules/private/cache/build_cache.lua
index 2ae2bb96b..5ca833dde 100644
--- a/xmake/modules/private/cache/build_cache.lua
+++ b/xmake/modules/private/cache/build_cache.lua
@@ -67,7 +67,15 @@ function is_enabled(target)
end
-- disable ccache on ci
if result == nil and ci_is_running() then
- result = false
+ local action_build_cache = _g._ACTION_BUILD_CACHE
+ if action_build_cache == nil then
+ action_build_cache = os.getenv("XMAKE_ACTION_BUILD_CACHE")
+ _g._ACTION_BUILD_CACHE = action_build_cache or false
+ end
+ -- we cannot disable it if github-action-setup-xmake/build-cache is enabled
+ if not action_build_cache then
+ result = false
+ end
end
-- disable ccache for msvc, because cl.exe preprocessor is too slower
-- @see https://github.com/xmake-io/xmake/issues/3532