diff options
| author | ruki <[email protected]> | 2023-03-20 22:29:12 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-03-20 22:29:12 +0800 |
| commit | 2891d0a122e4d320a7b3880810595652f21d0ce6 (patch) | |
| tree | 82c04a76178699ddd89499b62455f53d867bb86c /xmake/modules/private/cache/build_cache.lua | |
| parent | 8f80d4f01d31bf3a873e7b5797d3ed97c569f23e (diff) | |
disable ccache on ci
Diffstat (limited to 'xmake/modules/private/cache/build_cache.lua')
| -rw-r--r-- | xmake/modules/private/cache/build_cache.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/xmake/modules/private/cache/build_cache.lua b/xmake/modules/private/cache/build_cache.lua index 27e4cee7c..bac6c069b 100644 --- a/xmake/modules/private/cache/build_cache.lua +++ b/xmake/modules/private/cache/build_cache.lua @@ -25,6 +25,7 @@ import("core.cache.memcache") import("core.project.config") import("core.project.policy") import("core.project.project") +import("utils.ci.is_running", {alias = "ci_is_running"}) import("private.service.client_config") import("private.service.remote_cache.client", {alias = "remote_cache_client"}) @@ -54,7 +55,7 @@ function is_enabled(target) local result = _memcache():get2("enabled", key) if result == nil then -- target may be option instance - if target and target.policy then + if result == nil and target and target.policy then result = target:policy("build.ccache") end if result == nil and os.isfile(os.projectfile()) then @@ -63,6 +64,10 @@ function is_enabled(target) result = policy end end + -- disable ccache on ci + if result == nil and ci_is_running() then + result = false + end -- disable ccache for msvc, because cl.exe preprocessor is too slower -- @see https://github.com/xmake-io/xmake/issues/3532 if result == nil and is_host("windows") and |
