summaryrefslogtreecommitdiff
path: root/xmake/core/project/project.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-09-05 16:28:47 +0800
committerruki <[email protected]>2017-09-05 16:28:47 +0800
commit59d673ea76a08ae2cbab83eaad82de915c8ee803 (patch)
treee5d60c357c6f3861add09014639df1f16a8dfb45 /xmake/core/project/project.lua
parent3df59e7a2ed5c0c5cf6951695434a33784179567 (diff)
remove deprecated bindings
Diffstat (limited to 'xmake/core/project/project.lua')
-rw-r--r--xmake/core/project/project.lua39
1 files changed, 22 insertions, 17 deletions
diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua
index 1e2935586..bd853ab7e 100644
--- a/xmake/core/project/project.lua
+++ b/xmake/core/project/project.lua
@@ -238,8 +238,6 @@ function project.interpreter()
-- option.add_xxx
, "option.add_deps"
, "option.add_vectorexts"
- , "option.add_bindings" -- deprecated
- , "option.add_rbindings" -- deprecated
}
, pathes =
{
@@ -505,6 +503,27 @@ function project._load_options(disable_filter)
if not ok then
return nil, errors
end
+
+ -- load the options from the project requires
+ for _, require_str in ipairs(table.wrap(project.get("requires"))) do
+
+ -- get the package name
+ local splitinfo = require_str:split('%s+')
+ local packageinfo = splitinfo[1]
+ local packagename = nil
+ local pos = packageinfo:find_last('@', true)
+ if pos then
+ packagename = packageinfo:sub(pos + 1)
+ else
+ packagename = packageinfo
+ end
+
+ -- check
+ assert(not results[packagename], "requires(\"" .. packagename .. "\") and option(\"" .. packagename .. "\") conflicts!")
+
+ -- add option
+ results[packagename] = {category = "requires", default = true, showmenu = true, description = "The " .. packagename .. " package"}
+ end
-- check options
local options = {}
@@ -741,22 +760,8 @@ function project.menu()
first = false
end
- -- deprecated: make bindings
- local bindings = nil
- if opt:get("bindings") then
- bindings = string.join(table.wrap(opt:get("bindings")), ',')
- end
- if opt:get("rbindings") then
- bindings = "!" .. string.join(table.wrap(opt:get("rbindings")), ",!")
- end
-
- -- make longname
- local longname = name
- if bindings ~= nil then
- longname = longname .. ":" .. bindings
- end
-
-- append it
+ local longname = name
local descriptions = opt:get("description")
if descriptions then