summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzjyhjqs <[email protected]>2023-09-11 23:16:44 +0800
committerzjyhjqs <[email protected]>2023-09-11 23:26:52 +0800
commitc701605661341751fd85f44eb342ddd9b906394f (patch)
tree166194b75f810b53c3145b3acb6b24a61d05e4e1
parentf3db883a0e206b5dbb6cf2f54b65a5f47240e953 (diff)
fix the logical error when disabling the search of system packages during cross-compilation.
(3rd-party package shouldn't be treated as system package)
-rw-r--r--xmake/core/package/package.lua11
1 files changed, 4 insertions, 7 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