From 5ae6718ca77480542aef533ea90f799e05c46aec Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 3 Apr 2024 23:29:28 +0800 Subject: fix system.find_package --- xmake/modules/package/manager/system/find_package.lua | 5 +++-- 1 file 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 -- cgit v1.3.1