summaryrefslogtreecommitdiff
path: root/xmake/core/package/package.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/package/package.lua
parent13e02d0fa943dfd9ea3a0f4c2184a3df46058a20 (diff)
improve on_xxx script
Diffstat (limited to 'xmake/core/package/package.lua')
-rw-r--r--xmake/core/package/package.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 799776582..301a4ea94 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -673,9 +673,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 = {}
@@ -687,7 +691,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