summaryrefslogtreecommitdiff
path: root/xmake/core/package/package.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-01-11 00:57:49 +0800
committerruki <[email protected]>2025-01-11 00:57:49 +0800
commit1f34ccd505a67d3e71803d07e8d7bc7f1b9be4fd (patch)
tree38688834c829d19883eced3913f8961de9e31e71 /xmake/core/package/package.lua
parent4810c79dcd1759389791148496d2b62bfdc90191 (diff)
improve to check pkgconfig/importfiles
Diffstat (limited to 'xmake/core/package/package.lua')
-rw-r--r--xmake/core/package/package.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index f81bf2a0a..ea33e24fa 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -2721,14 +2721,17 @@ end
--
function _instance:check_importfiles(names, opt)
opt = opt or {}
- if opt.configdirs == nil then
- local configdirs = {}
+ if opt.PKG_CONFIG_PATH == nil then
+ local PKG_CONFIG_PATH = {}
local linkdirs = table.wrap(self:get("linkdirs") or "lib")
local installdir = self:installdir()
for _, linkdir in ipairs(linkdirs) do
- table.insert(configdirs, path.join(installdir, linkdir))
+ table.insert(PKG_CONFIG_PATH, path.join(installdir, linkdir, "pkgconfig"))
end
- opt.configdirs = configdirs
+ opt.PKG_CONFIG_PATH = PKG_CONFIG_PATH
+ end
+ if opt.CMAKE_PREFIX_PATH == nil then
+ opt.CMAKE_PREFIX_PATH = self:installdir()
end
return sandbox_module.import("lib.detect.check_importfiles", {anonymous = true})(names or ("pkgconfig::" .. self:name()), opt)
end