summaryrefslogtreecommitdiff
path: root/xmake/core/package/package.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-01-11 00:48:01 +0800
committerruki <[email protected]>2025-01-11 00:48:01 +0800
commit4bd329ef8184659bfbd221bf80efc5d7ee30e63f (patch)
tree62789ed4f865c3c2ca860ab7602af366b8150411 /xmake/core/package/package.lua
parente470863c24280ad3566d35b16ad184d3781510af (diff)
check pkgconfig
Diffstat (limited to 'xmake/core/package/package.lua')
-rw-r--r--xmake/core/package/package.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 741ca318c..a5d6283db 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -2712,6 +2712,27 @@ function _instance:check_fcsnippets(snippets, opt)
return sandbox_module.import("lib.detect.check_fcsnippets", {anonymous = true})(snippets, opt)
end
+-- check the given pkgconfig file?
+--
+-- @param name the .pc filename (without .pc extension)
+-- @param opt the argument options
+--
+-- @return true or false, errors
+--
+function _instance:check_pkgconfig(name, opt)
+ opt = opt or {}
+ if opt.configdirs == nil then
+ local configdirs = {}
+ 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))
+ end
+ opt.configdirs = configdirs
+ end
+ return sandbox_module.import("lib.detect.check_pkgconfig", {anonymous = true})(name or self:name(), opt)
+end
+
-- the current mode is belong to the given modes?
function package._api_is_mode(interp, ...)
return config.is_mode(...)