summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-04-03 23:29:28 +0800
committerruki <[email protected]>2024-04-03 23:29:28 +0800
commit5ae6718ca77480542aef533ea90f799e05c46aec (patch)
treed17ee156617e8c08cf30a1e02b8c540c39a5728e
parentbefc1ba876323c2df0030b9828bcdfad93b4a092 (diff)
fix system.find_package
-rw-r--r--xmake/modules/package/manager/system/find_package.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/xmake/modules/package/manager/system/find_package.lua b/xmake/modules/package/manager/system/find_package.lua
index 0d0db8a18..dd1fd099a 100644
--- a/xmake/modules/package/manager/system/find_package.lua
+++ b/xmake/modules/package/manager/system/find_package.lua
@@ -39,7 +39,7 @@ end
-- check package toolchains
function _check_package_toolchains(package)
local has_standalone
- for _, toolchain_inst in pairs(package:toolchains()) do
+ for _, toolchain_inst in ipairs(package:toolchains()) do
if toolchain_inst:check() and toolchain_inst:is_standalone() then
has_standalone = true
end
@@ -71,7 +71,8 @@ function main(name, opt)
--
-- But if it depends on some toolchain packages,
-- then they can't be detected early in the fetch and we have to disable system.find_package
- if opt.package and not _check_package_toolchains(opt.package) then
+ local package = opt.package
+ if package and package:toolchains() and not _check_package_toolchains(package) then
return
end