summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-05-01 23:09:09 +0800
committerGitHub <[email protected]>2024-05-01 23:09:09 +0800
commitc2f2ad5d2818eeefc487896d673c2585829108bf (patch)
tree8ac98d5c4f8a488af65493504844a34e3017eabb
parentf6cd253d33ecaa60087e9dd22a5bd92afb31c40f (diff)
parent4d8644f9d34ac5e250bc1b434f59d165693906e3 (diff)
Merge pull request #5039 from SirLynix/patch-16
pkgconfig: don't find packages when cross-compiling (fix #5028)
-rw-r--r--xmake/modules/package/manager/pkgconfig/find_package.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/xmake/modules/package/manager/pkgconfig/find_package.lua b/xmake/modules/package/manager/pkgconfig/find_package.lua
index 792f99c7a..041aa8629 100644
--- a/xmake/modules/package/manager/pkgconfig/find_package.lua
+++ b/xmake/modules/package/manager/pkgconfig/find_package.lua
@@ -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
@@ -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)