From 7d04cac9b2f8b50fb6b89fae1922ea595f28e070 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 12 Dec 2023 00:30:39 +0800 Subject: improve find_package --- xmake/modules/package/manager/find_package.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xmake/modules/package/manager/find_package.lua b/xmake/modules/package/manager/find_package.lua index acf560a40..430614064 100644 --- a/xmake/modules/package/manager/find_package.lua +++ b/xmake/modules/package/manager/find_package.lua @@ -54,18 +54,20 @@ function _find_package_with_builtin_rule(package_name, opt) table.insert(managers, "conan") -- only support the current sub-host platform and sub-architecture, e.g. linux, macosx, or msys (subsystem) - if opt.plat == os.subhost() and opt.arch == os.subarch() then + local plat = opt.plat + local arch = opt.arch + if plat == os.subhost() and arch == os.subarch() then -- find it from pkg-config table.insert(managers, "pkgconfig") -- find it from pacman - if is_subhost("linux", "msys") and not is_plat("windows") and find_tool("pacman") then + if is_subhost("linux", "msys") and plat ~= "windows" and find_tool("pacman") then table.insert(managers, "pacman") end -- find it from portage - if is_subhost("linux", "msys") and not is_plat("windows") and find_tool("emerge") then + if is_subhost("linux", "msys") and plat ~= "windows" and find_tool("emerge") then table.insert(managers, "portage") end -- cgit v1.3.1