From 4fd8d5eec226060ee62b24c56ae4e303d4ededba Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 21 Sep 2024 00:38:24 +0800 Subject: improve host toolchain #5639 --- xmake/modules/private/action/require/impl/utils/requirekey.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'xmake/modules/private/action/require/impl/utils/requirekey.lua') 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 -- cgit v1.3.1