summaryrefslogtreecommitdiff
path: root/xmake/actions/require/impl/package.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-03-14 23:20:22 +0800
committerruki <[email protected]>2019-03-14 14:02:15 +0800
commit502b015d4f0289733cc0202567337347d23d55ca (patch)
tree1c42f1d770a5481276388944bc4dc1d4a647580c /xmake/actions/require/impl/package.lua
parent98673a8aaf92c8cf5c8bddeb49f1c02a69952ac1 (diff)
rename to restrict
Diffstat (limited to 'xmake/actions/require/impl/package.lua')
-rw-r--r--xmake/actions/require/impl/package.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/xmake/actions/require/impl/package.lua b/xmake/actions/require/impl/package.lua
index 8e9aabe1b..dbed2aee8 100644
--- a/xmake/actions/require/impl/package.lua
+++ b/xmake/actions/require/impl/package.lua
@@ -299,7 +299,7 @@ end
-- package("pcre2")
-- add_configs("bitwidth", {description = "Set the code unit width.", default = "8", values = {"8", "16", "32"}})
-- add_configs("bitwidth", {type = "number", values = {8, 16, 32}})
--- add_configs("bitwidth", {constraint = function(value) if tonumber(value) < 100 then return true end})
+-- add_configs("bitwidth", {restrict = function(value) if tonumber(value) < 100 then return true end})
--
function _check_packages_configs(packages)
for _, package in ipairs(packages) do
@@ -326,8 +326,8 @@ function _check_packages_configs(packages)
raise("package(%s %s): invalid value(%s) for config(%s), please run `xmake require --info %s` to get all valid values!", package:name(), package:version_str(), value, name, package:name())
end
end
- if conf.constraint then
- if not conf.constraint(value) then
+ if conf.restrict then
+ if not conf.restrict(value) then
raise("package(%s %s): invalid value(%s) for config(%s)!", package:name(), package:version_str(), value, name)
end
end