Skip to content

Commit

Permalink
improve rule:script
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed May 14, 2019
1 parent b18c9aa commit fc53dfc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion xmake/core/project/rule.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand All @@ -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
Expand Down

0 comments on commit fc53dfc

Please sign in to comment.