From 502b015d4f0289733cc0202567337347d23d55ca Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 14 Mar 2019 23:20:22 +0800 Subject: rename to restrict --- xmake/actions/require/impl/package.lua | 6 +++--- 1 file 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 -- cgit v1.3.1