summaryrefslogtreecommitdiff
path: root/xmake/core/package/package.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-04-24 00:34:33 +0800
committerruki <[email protected]>2019-04-23 21:27:19 +0800
commita4b4fff7cb09c6a8359bad4ee204559eb0e41c35 (patch)
treead4d4ae5a9eaff5a765a7c83040e84b6d757dc07 /xmake/core/package/package.lua
parent6a430c2260ea9ba01cfd164bfe265157b15c235f (diff)
improve autoconf tools
Diffstat (limited to 'xmake/core/package/package.lua')
-rw-r--r--xmake/core/package/package.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 690197179..3e60043af 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -113,6 +113,26 @@ function _instance:repo()
return self._REPO
end
+-- the current platform is belong to the given platforms?
+function _instance:is_plat(...)
+ local plat = self:plat()
+ for _, v in ipairs(table.join(...)) do
+ if v and plat == v then
+ return true
+ end
+ end
+end
+
+-- the current architecture is belong to the given architectures?
+function _instance:is_arch(...)
+ local arch = self:arch()
+ for _, v in ipairs(table.join(...)) do
+ if v and arch:find("^" .. v:gsub("%-", "%%-") .. "$") then
+ return true
+ end
+ end
+end
+
-- get the package alias
function _instance:alias()
local requireinfo = self:requireinfo()