diff options
| author | ruki <[email protected]> | 2018-11-24 00:46:54 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-11-23 22:41:27 +0800 |
| commit | 032d8ad7cf6690e15e63c463e72d1039eb4b8dd9 (patch) | |
| tree | f6b51a77a6e862d23002326f0297b43fe0531cc9 | |
| parent | 17e064c41270a9d270fcfb7c6438c49d4fbfaa63 (diff) | |
mark as registered in same group
| -rw-r--r-- | xmake/actions/require/install.lua | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/xmake/actions/require/install.lua b/xmake/actions/require/install.lua index c9ddb0974..8217cd156 100644 --- a/xmake/actions/require/install.lua +++ b/xmake/actions/require/install.lua @@ -66,11 +66,24 @@ end -- register all required local packages function _register_required_packages(packages) + local registered_in_group = {} for _, instance in ipairs(packages) do - if instance:kind() ~= "binary" then - local requireinfo = project.require(instance:alias() or instance:name()) - if requireinfo then - _register_required_package(instance, requireinfo) + + -- only register the first package in same group + local group = instance:group() + if not group or not registered_in_group[group] then + + -- do not register binary package + if instance:kind() ~= "binary" then + local requireinfo = project.require(instance:alias() or instance:name()) + if requireinfo then + _register_required_package(instance, requireinfo) + end + end + + -- mark as registered in group + if group then + registered_in_group[group] = true end end end |
