summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-05-14 23:25:03 +0800
committerruki <[email protected]>2019-05-14 14:30:18 +0800
commitfc53dfc3f6582bb9e463b88a2f3b6e68c1b11625 (patch)
tree531a0089066d993336ece488b73a20f6c9a1366b
parentb18c9aa8873edef1d6fc4c56a236a713282e1a6b (diff)
improve rule:script
-rw-r--r--xmake/core/project/rule.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/core/project/rule.lua b/xmake/core/project/rule.lua
index 8bf3b3f3e..f51cc2a6b 100644
--- a/xmake/core/project/rule.lua
+++ b/xmake/core/project/rule.lua
@@ -246,9 +246,13 @@ function rule: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 = {}
@@ -260,7 +264,7 @@ function rule: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