summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-12-03 23:33:30 +0800
committerruki <[email protected]>2024-12-03 23:33:30 +0800
commitd36ccc63a37662aa47359be90dc19cd6f09c32a5 (patch)
treecd4fc8a0ac0550877ee5dd31e0584a3e71ae8a9a
parentdf467da416ce72c90a79eb106673bb0f13ef7197 (diff)
resolve configs
-rw-r--r--xmake/modules/private/action/require/impl/package.lua36
1 files changed, 20 insertions, 16 deletions
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua
index b030f7eec..178fd4542 100644
--- a/xmake/modules/private/action/require/impl/package.lua
+++ b/xmake/modules/private/action/require/impl/package.lua
@@ -183,6 +183,26 @@ function _load_require(require_str, requires_extra, opt)
end
end
+ -- resolve require info
+ local resolvedinfo = opt.resolvedinfo
+ local requirepath = opt.requirepath
+ if requirepath then
+ requirepath = requirepath .. "." .. packagename
+ else
+ requirepath = packagename
+ end
+ resolvedinfo = resolvedinfo and resolvedinfo[requirepath]
+ if resolvedinfo then
+ -- resolve the conflict package version
+ if resolvedinfo.version then
+ version = resolvedinfo.version
+ end
+ -- resolve the conflict package configs
+ if resolvedinfo.configs then
+ require_extra.configs = resolvedinfo.configs
+ end
+ end
+
-- get required building configurations
-- we need to clone a new configs object, because the whole requireinfo will be modified later.
-- @see https://github.com/xmake-io/xmake-repo/pull/2067
@@ -216,22 +236,6 @@ function _load_require(require_str, requires_extra, opt)
require_extra.system = false
end
- -- resolve require info
- local resolvedinfo = opt.resolvedinfo
- local requirepath = opt.requirepath
- if requirepath then
- requirepath = requirepath .. "." .. packagename
- else
- requirepath = packagename
- end
- resolvedinfo = resolvedinfo and resolvedinfo[requirepath]
- if resolvedinfo then
- -- resolve the conflict package version
- if resolvedinfo.version then
- version = resolvedinfo.version
- end
- end
-
-- init required item
local required = {}
local parentinfo = opt.parentinfo