From d36ccc63a37662aa47359be90dc19cd6f09c32a5 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 3 Dec 2024 23:33:30 +0800 Subject: resolve configs --- .../private/action/require/impl/package.lua | 36 ++++++++++++---------- 1 file 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 -- cgit v1.3.1