summaryrefslogtreecommitdiff
path: root/xmake/modules/private/action/require/impl/package.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules/private/action/require/impl/package.lua')
-rw-r--r--xmake/modules/private/action/require/impl/package.lua22
1 files changed, 16 insertions, 6 deletions
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua
index 5c644be1c..66b26a602 100644
--- a/xmake/modules/private/action/require/impl/package.lua
+++ b/xmake/modules/private/action/require/impl/package.lua
@@ -942,13 +942,8 @@ function _must_depend_on(package, dep)
end
end
--- the cache directory
-function cachedir()
- return path.join(global.directory(), "cache", "packages")
-end
-
-- this package should be install?
-function should_install(package)
+function _should_install(package)
if package:is_template() or package:exists() then
return false
end
@@ -987,6 +982,21 @@ function should_install(package)
end
end
+-- the cache directory
+function cachedir()
+ return path.join(global.directory(), "cache", "packages")
+end
+
+-- this package should be install?
+function should_install(package)
+ local result = _memcache():get2("should_install", tostring(package))
+ if result == nil then
+ result = _should_install(package) or false
+ _memcache():set2("should_install", tostring(package), result)
+ end
+ return result
+end
+
-- get package configs string
function get_configs_str(package)
local configs = {}