diff options
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/package/manager/system/find_package.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/xmake/modules/package/manager/system/find_package.lua b/xmake/modules/package/manager/system/find_package.lua index 862862d5a..2a7b4727c 100644 --- a/xmake/modules/package/manager/system/find_package.lua +++ b/xmake/modules/package/manager/system/find_package.lua @@ -36,6 +36,17 @@ function _get_package_items() return items end +-- check package toolchains +function _check_package_toolchains(package) + local has_standalone + for _, toolchain_inst in pairs(package:toolchains()) do + if toolchain_inst:check() and toolchain_inst:is_standalone() then + has_standalone = true + end + end + return has_standalone +end + -- find package from system and compiler -- @see https://github.com/xmake-io/xmake/issues/4596 -- @@ -55,6 +66,12 @@ function main(name, opt) end snippet_configs.links = snippet_configs.links or name + -- we need to check package toolchain first + -- https://github.com/xmake-io/xmake/issues/4596#issuecomment-2014528801 + if opt.package and not _check_package_toolchains(opt.package) then + return + end + local snippet_opt = { verbose = opt.verbose, target = opt.package, |
