summaryrefslogtreecommitdiff
path: root/xmake/modules/private/cache/build_cache.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-05-19 00:54:45 +0800
committerruki <[email protected]>2022-05-19 00:54:45 +0800
commite0e5d36e264fc580802c93e26103d604e61f6a00 (patch)
tree7905dd9ebc5d8d07b09417bf37ee972b53df18f5 /xmake/modules/private/cache/build_cache.lua
parent0bb56c9a4efc55c6f478b49340607cb651656159 (diff)
improve cacheky
Diffstat (limited to 'xmake/modules/private/cache/build_cache.lua')
-rw-r--r--xmake/modules/private/cache/build_cache.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/xmake/modules/private/cache/build_cache.lua b/xmake/modules/private/cache/build_cache.lua
index 62ddeafa2..0144317aa 100644
--- a/xmake/modules/private/cache/build_cache.lua
+++ b/xmake/modules/private/cache/build_cache.lua
@@ -45,7 +45,9 @@ end
-- get cache key
function cachekey(program, cppfile, cppflags, envs)
local items = {program}
- table.join2(items, cppflags)
+ for _, cppflag in ipairs(cppflags) do
+ table.insert(items, cppflag)
+ end
table.sort(items)
table.insert(items, hash.sha256(cppfile))
if envs then
@@ -59,12 +61,12 @@ function cachekey(program, cppfile, cppflags, envs)
end
end
end
- return (hash.uuid(table.concat(items, "")):gsub("-", "")):lower()
+ return (hash.uuid(table.concat(items, "")):gsub("-", ""))
end
-- get cache root directory
function rootdir()
- return path.join(config.buildir(), ".cache")
+ return path.join(config.buildir(), ".build_cache")
end
-- clean cached files