diff options
| author | ruki <[email protected]> | 2024-09-21 00:38:24 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-09-23 09:43:53 +0800 |
| commit | 4fd8d5eec226060ee62b24c56ae4e303d4ededba (patch) | |
| tree | 6094540f11896427cce7373e4e37d983dfc56951 /xmake/modules/private/action/require/impl/utils/requirekey.lua | |
| parent | 478972cd989f6788925669b91d0bd8b4b38b2604 (diff) | |
improve host toolchain #5639
Diffstat (limited to 'xmake/modules/private/action/require/impl/utils/requirekey.lua')
| -rw-r--r-- | xmake/modules/private/action/require/impl/utils/requirekey.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/xmake/modules/private/action/require/impl/utils/requirekey.lua b/xmake/modules/private/action/require/impl/utils/requirekey.lua index bfd724d06..9378a8cb7 100644 --- a/xmake/modules/private/action/require/impl/utils/requirekey.lua +++ b/xmake/modules/private/action/require/impl/utils/requirekey.lua @@ -20,6 +20,7 @@ -- imports import("core.base.hashset") +import("core.package.package", {alias = "core_package"}) -- get require key from requireinfo function main(requireinfo, opt) @@ -43,6 +44,14 @@ function main(requireinfo, opt) if requireinfo.label then key = key .. "/" .. requireinfo.label end + if requireinfo.host then + if is_subhost(core_package.targetplat()) and os.subarch() == core_package.targetarch() then + -- we need to pass plat/arch to avoid repeat installation + -- @see https://github.com/xmake-io/xmake/issues/1579 + else + key = key .. "/host" + end + end if requireinfo.system then key = key .. "/system" end |
