summaryrefslogtreecommitdiff
path: root/xmake/modules/private/action/require/impl/package.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-08-20 22:37:18 +0800
committerruki <[email protected]>2021-08-20 22:37:18 +0800
commitc95fdc3f443b3dee83708b42bc34383a47601e13 (patch)
tree31c0c1761b01b3a88f7748f12b70db9e31a39c4c /xmake/modules/private/action/require/impl/package.lua
parentaa1fcf6c858bb139927c9e1d36e70bd7197ba8fb (diff)
improve host package
Diffstat (limited to 'xmake/modules/private/action/require/impl/package.lua')
-rw-r--r--xmake/modules/private/action/require/impl/package.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua
index 5084d2d29..95a54a008 100644
--- a/xmake/modules/private/action/require/impl/package.lua
+++ b/xmake/modules/private/action/require/impl/package.lua
@@ -152,8 +152,13 @@ function _load_require(require_str, requires_extra, parentinfo)
-- require packge in the current host platform
if require_extra.host then
- require_extra.plat = os.host()
- require_extra.arch = os.arch()
+ if is_subhost(core_package.targetplat()) and os.subarch() == core_package.targetarch() then
+ -- we need pass plat/arch to avoid repeat installation
+ -- @see https://github.com/xmake-io/xmake/issues/1579
+ else
+ require_extra.plat = os.subhost()
+ require_extra.arch = os.subarch()
+ end
end
-- init required item