summaryrefslogtreecommitdiff
path: root/xmake/core/project/target.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-09-24 00:33:54 +0800
committerruki <[email protected]>2020-09-24 00:33:54 +0800
commit87119fd4fa17d754c8cc867caa9b60e4a8836c82 (patch)
treedfd962c4c5fe762478c9c161fa73571bad7a0a60 /xmake/core/project/target.lua
parent8184f42f9b96b5c0fdedc7b1161dfc43d9659dd2 (diff)
improve install action
Diffstat (limited to 'xmake/core/project/target.lua')
-rw-r--r--xmake/core/project/target.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 8bb538ddb..cc5c86496 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -454,6 +454,26 @@ function _instance:arch()
return self:get("arch") or config.get("arch") or os.arch()
end
+-- the current target 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 target 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 platform instance
function _instance:platform()
local platform_inst = self._PLATFORM