Skip to content

Commit

Permalink
Merge pull request #5039 from SirLynix/patch-16
Browse files Browse the repository at this point in the history
pkgconfig: don't find packages when cross-compiling (fix #5028)
  • Loading branch information
waruqi committed May 1, 2024
2 parents f6cd253 + 4d8644f commit c2f2ad5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions xmake/modules/package/manager/pkgconfig/find_package.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

-- imports
import("lib.detect.pkgconfig")
import("private.core.base.is_cross")
import("package.manager.system.find_package", {alias = "find_package_from_system"})

-- find package from the pkg-config package manager
Expand All @@ -28,9 +29,10 @@ import("package.manager.system.find_package", {alias = "find_package_from_system
-- @param opt the options, e.g. {verbose = true, version = "1.12.x")
--
function main(name, opt)

-- init options
opt = opt or {}
if is_cross(opt.plat, opt.arch) then
return
end

-- get library info
local libinfo = pkgconfig.libinfo(name, opt)
Expand Down

0 comments on commit c2f2ad5

Please sign in to comment.