summaryrefslogtreecommitdiff
path: root/xmake/core/project/target.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-05-10 22:55:10 +0800
committerruki <[email protected]>2019-05-10 11:31:03 +0800
commit11a61399f708e73df2c47b31cf4fd4d3f16495bc (patch)
treea52dbe031ef11b853ac35ba0c703ec1c7deeb526 /xmake/core/project/target.lua
parent13e02d0fa943dfd9ea3a0f4c2184a3df46058a20 (diff)
improve on_xxx script
Diffstat (limited to 'xmake/core/project/target.lua')
-rw-r--r--xmake/core/project/target.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 86b86fe70..f4809f424 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -1338,9 +1338,13 @@ function _instance:script(name, generic)
-- match pattern
--
+ -- `@linux`
+ -- `@linux|x86_64`
-- `@macosx,linux`
-- `android@macosx,linux`
-- `android|armv7-a@macosx,linux`
+ -- `android|armv7-a@macosx,linux|x86_64`
+ -- `android|armv7-a@linux|x86_64`
--
for _pattern, _script in pairs(script) do
local hosts = {}
@@ -1352,7 +1356,7 @@ function _instance:script(name, generic)
end
return ""
end)
- if not _pattern:startswith("__") and (not hosts_spec or hosts[os.host()])
+ if not _pattern:startswith("__") and (not hosts_spec or hosts[os.host() .. '|' .. os.arch()] or hosts[os.host()])
and (_pattern:trim() == "" or (plat .. '|' .. arch):find('^' .. _pattern .. '$') or plat:find('^' .. _pattern .. '$')) then
result = _script
break