diff options
| author | ruki <[email protected]> | 2023-12-12 00:30:39 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-12-12 00:30:39 +0800 |
| commit | 7d04cac9b2f8b50fb6b89fae1922ea595f28e070 (patch) | |
| tree | 1526d60db258ee26dd75e6637643f1aeb6c6d290 /xmake/modules | |
| parent | 4262122871733078442170e9d9d656d30e2801fa (diff) | |
improve find_package
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/package/manager/find_package.lua | 8 |
1 files 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 |
