Skip to content

Commit

Permalink
fix package linkgroups #5806
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Nov 22, 2024
1 parent 9b75cbb commit 6be0e0d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
31 changes: 29 additions & 2 deletions xmake/core/project/package.lua
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,24 @@ function _instance:extraconf(name, item, key)
return value
end

-- add extra configuration
function _instance:extraconf_add(name, item)
local extraconfs = self:get("extras")
if not extraconfs then
extraconfs = {}
end

local extraconf = extraconfs[name]
if extraconf ~= nil then
extraconf = table.wrap(extraconf)
table.join2(extraconf, item)
else
extraconf = item
end
extraconfs[name] = extraconf
self:set("extras", extraconfs)
end

-- get order dependencies of the given component
function _instance:component_orderdeps(name)
local component_orderdeps = self._COMPONENT_ORDERDEPS
Expand Down Expand Up @@ -252,8 +270,17 @@ end
-- add the value to the requires info
function _instance:add(name_or_info, ...)
if type(name_or_info) == "string" then
local info = table.wrap(self._INFO[name_or_info])
self._INFO[name_or_info] = table.unwrap(table.unique(table.join(info, ...)))
local name = name_or_info
if name == "extras" then
for _, extraconf in ipairs({...}) do
for k, v in pairs(extraconf) do
self:extraconf_add(k, v)
end
end
else
local info = table.wrap(self._INFO[name])
self._INFO[name] = table.unwrap(table.unique(table.join(info, ...)))
end
elseif table.is_dictionary(name_or_info) then
for name, info in pairs(table.join(name_or_info, ...)) do
self:add(name, info)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ function _register_required_package_libs(instance, required_package, is_deps)
fetchinfo.static = nil
fetchinfo.shared = nil
fetchinfo.installdir = nil
fetchinfo.extras = nil
fetchinfo.components = nil
end

Expand Down

0 comments on commit 6be0e0d

Please sign in to comment.