diff options
| author | ruki <[email protected]> | 2023-09-13 09:32:19 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-09-13 09:32:19 +0800 |
| commit | 5946aefcaf1096a6466f23b512b119f3a0b7b715 (patch) | |
| tree | 7d1b69609b5a7de2f089d5f6d08ed8b9b36df7ed | |
| parent | 33e3ec4d980182980a3979ff7fbd76400f40eb41 (diff) | |
| parent | 0647ebc1f3fd014d15712f730d175e96378eb4f2 (diff) | |
Merge pull request #4193 from zjyhjqs/master
Fix the behaviour caused by system package being disabled during cross-compilation
| -rw-r--r-- | xmake/core/package/package.lua | 11 | ||||
| -rw-r--r-- | xmake/modules/private/action/require/impl/install_packages.lua | 6 |
2 files changed, 9 insertions, 8 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index ed6042518..a18d6f882 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -1756,9 +1756,6 @@ function _instance:fetch(opt) -- we need ignore `{system = true/false}` argument if be 3rd package -- @see https://github.com/xmake-io/xmake/issues/726 system = nil - elseif self:is_cross() then - -- we need to disable system package for cross-compilation - system = false end -- use sysincludedirs/-isystem instead of -I? @@ -1782,8 +1779,8 @@ function _instance:fetch(opt) end end - -- fetch it from the system directories - if not fetchinfo and system ~= false then + -- fetch it from the system directories (disabled for cross-compilation) + if not fetchinfo and system ~= false and not self:is_cross() then fetchinfo = self:_fetch_tool({system = true, require_version = require_ver, force = opt.force}) if fetchinfo then is_system = true @@ -1799,8 +1796,8 @@ function _instance:fetch(opt) end end - -- fetch it from the system and external package sources - if not fetchinfo and system ~= false then + -- fetch it from the system and external package sources (disabled for cross-compilation) + if not fetchinfo and system ~= false and not self:is_cross() then fetchinfo = self:_fetch_library({system = true, require_version = require_ver, external = external, force = opt.force}) if fetchinfo then is_system = true diff --git a/xmake/modules/private/action/require/impl/install_packages.lua b/xmake/modules/private/action/require/impl/install_packages.lua index 6fd659182..dbf13c88e 100644 --- a/xmake/modules/private/action/require/impl/install_packages.lua +++ b/xmake/modules/private/action/require/impl/install_packages.lua @@ -733,7 +733,11 @@ function main(requires, opt) -- exists not found packages? if #packages_not_found > 0 then - cprint("${bright color.warning}note: ${clear}the following packages were not found on your system, try again after installing them:") + if packages_not_found[1]:is_cross() then + cprint("${bright color.warning}note: ${clear}system package is not supported for cross-compilation currently, the following system packages cannot be found:") + else + cprint("${bright color.warning}note: ${clear}the following packages were not found on your system, try again after installing them:") + end for _, instance in ipairs(packages_not_found) do print(" -> %s %s", instance:displayname(), instance:version_str() or "") end |
