diff options
| author | ruki <[email protected]> | 2017-09-09 00:46:23 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-09-08 22:38:23 +0800 |
| commit | bfd5744eadf1d4d83221a7a4fd313235e106a9a3 (patch) | |
| tree | aa8028ddfa720e103ef8ef9840f6639850bf0096 /xmake/core/project/project.lua | |
| parent | 7755ecd8b9b751cfec483bb16d30a4764f1aad14 (diff) | |
improve to dump require list
Diffstat (limited to 'xmake/core/project/project.lua')
| -rw-r--r-- | xmake/core/project/project.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua index bd853ab7e..1c873987a 100644 --- a/xmake/core/project/project.lua +++ b/xmake/core/project/project.lua @@ -505,6 +505,7 @@ function project._load_options(disable_filter) end -- load the options from the project requires + local requires_extra = project.get("__extra_requires") or {} for _, require_str in ipairs(table.wrap(project.get("requires"))) do -- get the package name @@ -521,8 +522,19 @@ function project._load_options(disable_filter) -- check assert(not results[packagename], "requires(\"" .. packagename .. "\") and option(\"" .. packagename .. "\") conflicts!") + -- define package option + local packageopt = {category = "requires", default = true, showmenu = true, description = "The " .. packagename .. " package"} + + -- inherit extra option settings and override the default values + local require_extra = requires_extra[require_str] + if require_extra then + for name, value in pairs(table.wrap(require_extra.option)) do + packageopt[name] = value + end + end + -- add option - results[packagename] = {category = "requires", default = true, showmenu = true, description = "The " .. packagename .. " package"} + results[packagename] = packageopt end -- check options |
