From fc53dfc3f6582bb9e463b88a2f3b6e68c1b11625 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 14 May 2019 23:25:03 +0800 Subject: improve rule:script --- xmake/core/project/rule.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.3.1