summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-10-14 23:24:51 +0800
committerruki <[email protected]>2020-10-14 23:24:51 +0800
commit7104509afd465ee37e5d76d059aa1504da6a6a80 (patch)
tree82a606b89b7459a632714929763580ecc513881c
parent7ed6f98c2ebfead99b45fb7f4af369b3b47b2618 (diff)
improve package
-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 25f66f1ac..dbf94f490 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 includes?
+--
+-- @param includes the includes
+-- @param opt the argument options, e.g. { defines = ""}
+--
+-- @return true or false
+--
+function _instance:has_cincludes(includes, 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_cincludes", {anonymous = true})(includes, opt)
+end
+
+-- has the given c++ includes?
+--
+-- @param includes the includes
+-- @param opt the argument options, e.g. { defines = ""}
+--
+-- @return true or false
+--
+function _instance:has_cxxincludes(includes, 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_cxxincludes", {anonymous = true})(includes, opt)
+end
+
-- check the given c snippets?
--
-- @param snippets the snippets