summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/core/package/package.lua34
1 files changed, 34 insertions, 0 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index dbf94f490..ba66ecdd5 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -1045,6 +1045,40 @@ function _instance:has_cxxfuncs(funcs, opt)
return sandbox_module.import("lib.detect.has_cxxfuncs", {anonymous = true})(funcs, opt)
end
+-- has the given c types?
+--
+-- @param types the types
+-- @param opt the argument options, e.g. { defines = ""}
+--
+-- @return true or false
+--
+function _instance:has_ctypes(types, opt)
+ if self:plat() ~= config.get("plat") then
+ -- TODO
+ return true
+ end
+ opt = opt or {}
+ opt.configs = table.join(self:fetchdeps(), opt.configs)
+ return sandbox_module.import("lib.detect.has_ctypes", {anonymous = true})(types, opt)
+end
+
+-- has the given c++ types?
+--
+-- @param types the types
+-- @param opt the argument options, e.g. { defines = ""}
+--
+-- @return true or false
+--
+function _instance:has_cxxtypes(types, opt)
+ if self:plat() ~= config.get("plat") then
+ -- TODO
+ return true
+ end
+ opt = opt or {}
+ opt.configs = table.join(self:fetchdeps(), opt.configs)
+ return sandbox_module.import("lib.detect.has_cxxtypes", {anonymous = true})(types, opt)
+end
+
-- has the given c includes?
--
-- @param includes the includes