summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-08-18 23:02:26 +0800
committerruki <[email protected]>2024-08-23 08:14:32 +0800
commit3dbf27490cbfda4a18843ffb85b74eb30ed9839c (patch)
tree5b82687e118477c24a9ed231df6bfd3d6305aeb4
parent3000c00cfabfed31edd9e9a67d64045f5de7e589 (diff)
remove on_load limits
-rw-r--r--xmake/core/package/package.lua17
1 files changed, 0 insertions, 17 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 133531b46..d16be3529 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -1218,14 +1218,6 @@ function _instance:has_runtime(...)
end
end
--- check call limits in on_load
--- @see https://github.com/xmake-io/xmake/issues/5455
-function _instance:_check_limits_on_load(apiname)
- if not self._LOADED then
- os.raise("we cannot call package:%s() in on_load(), please call it in on_check/on_install/on_test.", apiname)
- end
-end
-
-- get the given toolchain
function _instance:toolchain(name)
local toolchains_map = self:_memcache():get("toolchains_map")
@@ -2522,7 +2514,6 @@ end
-- @return true or false, errors
--
function _instance:has_cxxincludes(includes, opt)
- self:_check_limits_on_load("has_cxxincludes")
opt = opt or {}
opt.target = self
opt.configs = self:_generate_build_configs(opt.configs, {sourcekind = "cxx"})
@@ -2537,7 +2528,6 @@ end
-- @return true or false, errors
--
function _instance:has_cflags(flags, opt)
- self:_check_limits_on_load("has_cflags")
local compinst = self:compiler("cc")
return compinst:has_flags(flags, "cflags", opt)
end
@@ -2550,7 +2540,6 @@ end
-- @return true or false, errors
--
function _instance:has_cxxflags(flags, opt)
- self:_check_limits_on_load("has_cxxflags")
local compinst = self:compiler("cxx")
return compinst:has_flags(flags, "cxxflags", opt)
end
@@ -2563,7 +2552,6 @@ end
-- @return true or false, errors
--
function _instance:has_features(features, opt)
- self:_check_limits_on_load("has_features")
opt = opt or {}
opt.target = self
return sandbox_module.import("core.tool.compiler", {anonymous = true}).has_features(features, opt)
@@ -2577,7 +2565,6 @@ end
-- @return the type size
--
function _instance:check_sizeof(typename, opt)
- self:_check_limits_on_load("check_sizeof")
opt = opt or {}
opt.target = self
return sandbox_module.import("lib.detect.check_sizeof", {anonymous = true})(typename, opt)
@@ -2591,7 +2578,6 @@ end
-- @return true or false, errors
--
function _instance:check_csnippets(snippets, opt)
- self:_check_limits_on_load("check_csnippets")
opt = opt or {}
opt.target = self
opt.configs = self:_generate_build_configs(opt.configs, {sourcekind = "cc"})
@@ -2606,7 +2592,6 @@ end
-- @return true or false, errors
--
function _instance:check_cxxsnippets(snippets, opt)
- self:_check_limits_on_load("check_cxxsnippets")
opt = opt or {}
opt.target = self
opt.configs = self:_generate_build_configs(opt.configs, {sourcekind = "cxx"})
@@ -2621,7 +2606,6 @@ end
-- @return true or false, errors
--
function _instance:check_msnippets(snippets, opt)
- self:_check_limits_on_load("check_msnippets")
opt = opt or {}
opt.target = self
opt.configs = self:_generate_build_configs(opt.configs, {sourcekind = "mm"})
@@ -2636,7 +2620,6 @@ end
-- @return true or false, errors
--
function _instance:check_mxxsnippets(snippets, opt)
- self:_check_limits_on_load("check_mxxsnippets")
opt = opt or {}
opt.target = self
opt.configs = self:_generate_build_configs(opt.configs, {sourcekind = "mxx"})