Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix package linkgroups #5806 #5866

Merged
merged 1 commit into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading