diff options
| author | ruki <[email protected]> | 2024-02-15 23:53:13 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-02-15 23:53:13 +0800 |
| commit | f1697c62acae223dd77cb7d8871a9aa1e4ff492d (patch) | |
| tree | 78f9654eb43053ac603f45115e497eb7a63564cc /xmake/core/package/package.lua | |
| parent | 197ec373651d6672f7a11e9a07a01fb7dacdb8fa (diff) | |
improve is_cross
Diffstat (limited to 'xmake/core/package/package.lua')
| -rw-r--r-- | xmake/core/package/package.lua | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index a3985a5e9..eef05d80e 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -35,6 +35,7 @@ local hashset = require("base/hashset") local scopeinfo = require("base/scopeinfo") local interpreter = require("base/interpreter") local select_script = require("base/private/select_script") +local is_cross = require("base/private/is_cross") local memcache = require("cache/memcache") local toolchain = require("tool/toolchain") local compiler = require("tool/compiler") @@ -684,27 +685,7 @@ end -- is cross-compilation? function _instance:is_cross() - if os.host() == "windows" then - 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 - end - end - if not self:is_plat(os.host()) and not self:is_plat(os.subhost()) then - return true - end - if not self:is_arch(os.arch()) and not self:is_arch(os.subarch()) then - return true - end + return is_cross(self:plat(), self:arch()) end -- get the filelock of the whole package directory |
