summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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