diff options
| author | ruki <[email protected]> | 2023-02-18 19:41:24 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-02-18 19:41:24 +0800 |
| commit | 7e6d4d4a0e7cd67393757770d50e50558481349b (patch) | |
| tree | f81c76e4c70daa766e28cd5fe404ff2caee3ed7f /xmake/core/package/package.lua | |
| parent | ab4a4b4872a6bdc70e4fa27a286d93123ec98a68 (diff) | |
improve is_cross
Diffstat (limited to 'xmake/core/package/package.lua')
| -rw-r--r-- | xmake/core/package/package.lua | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index fd7cc58e3..a189905f6 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -624,8 +624,15 @@ end -- is cross-compilation? function _instance:is_cross() if os.host() == "windows" then - if self:is_plat("windows") and - not self:is_arch("arm64") then -- maybe cross-compilation for arm64 on x86/x64 + local host_arch = os.arch() + if self:is_plat("windows") then + -- maybe cross-compilation for arm64 on x86/x64 + if (host_arch == "x86" or host_arch == "x64") and self:is_arch("arm64") then + return true + -- maybe cross-compilation for x86/64 on arm64 + elseif host_arch == "arm64" and not self:is_arch("arm64") then + return true + end return false elseif self:is_plat("mingw") then return false |
