summaryrefslogtreecommitdiff
path: root/xmake/core/package/package.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-04-17 23:55:26 +0800
committerruki <[email protected]>2019-04-17 17:32:36 +0800
commitda2e7200b81638ffae4ca46594b1ee8f37a6dca0 (patch)
tree7b80ec15c45eb9e6ee779c5cf49040d0c4863107 /xmake/core/package/package.lua
parentfd5f1f5a5b02967c13253dd7837abdb060d80cad (diff)
add check snippets for package
Diffstat (limited to 'xmake/core/package/package.lua')
-rw-r--r--xmake/core/package/package.lua30
1 files changed, 28 insertions, 2 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 9a2105282..c9e298a33 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -791,7 +791,7 @@ end
--
function _instance:has_cfuncs(funcs, opt)
opt = opt or {}
- opt.configs = self:fetchdeps()
+ opt.configs = table.join(self:fetchdeps(), opt.configs)
return sandbox_module.import("lib.detect.has_cfuncs", {anonymous = true})(funcs, opt)
end
@@ -804,10 +804,36 @@ end
--
function _instance:has_cxxfuncs(funcs, opt)
opt = opt or {}
- opt.configs = self:fetchdeps()
+ opt.configs = table.join(self:fetchdeps(), opt.configs)
return sandbox_module.import("lib.detect.has_cxxfuncs", {anonymous = true})(funcs, opt)
end
+-- check the given c snippets?
+--
+-- @param snippets the snippets
+-- @param opt the argument options, .e.g { includes = ""}
+--
+-- @return true or false
+--
+function _instance:check_csnippets(snippets, opt)
+ opt = opt or {}
+ opt.configs = table.join(self:fetchdeps(), opt.configs)
+ return sandbox_module.import("lib.detect.check_csnippets", {anonymous = true})(snippets, opt)
+end
+
+-- check the given c++ snippets?
+--
+-- @param snippets the snippets
+-- @param opt the argument options, .e.g { includes = ""}
+--
+-- @return true or false
+--
+function _instance:check_cxxsnippets(snippets, opt)
+ opt = opt or {}
+ opt.configs = table.join(self:fetchdeps(), opt.configs)
+ return sandbox_module.import("lib.detect.check_cxxsnippets", {anonymous = true})(snippets, opt)
+end
+
-- the current mode is belong to the given modes?
function package._api_is_mode(interp, ...)
return config.is_mode(...)