diff options
| author | ruki <[email protected]> | 2019-04-28 21:24:25 +0900 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-04-28 21:24:25 +0900 |
| commit | 2f36d5f5cd54d49ffe7eff324dc0522451deaae5 (patch) | |
| tree | dfb4f8bc4cdb179f722ae3c608505b2de659fb2a | |
| parent | 6051aaec944bc40dd8e53316bdd88451b14a8a19 (diff) | |
improve on_install for host
| -rw-r--r-- | xmake/core/package/package.lua | 20 | ||||
| -rw-r--r-- | xmake/platforms/android/xmake.lua | 2 | ||||
| -rw-r--r-- | xmake/platforms/iphoneos/xmake.lua | 2 |
3 files changed, 20 insertions, 4 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index f85a33e04..ff5335291 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -666,7 +666,15 @@ function _instance:script(name, generic) -- match script for special plat and arch local pattern = plat .. '|' .. arch for _pattern, _script in pairs(script) do - if not _pattern:startswith("__") and pattern:find('^' .. _pattern .. '$') then + local hosts = {} + _pattern = _pattern:gsub("@(.+)|", function (v) + -- get and remove hosts for `android@macosx,linux` + for _, host in ipairs(v:split(',')) do + hosts[host] = true + end + return "|" + end) + if not _pattern:startswith("__") and pattern:find('^' .. _pattern .. '$') and (#hosts == 0 or hosts[os.host()]) then result = _script break end @@ -675,7 +683,15 @@ function _instance:script(name, generic) -- match script for special plat if result == nil then for _pattern, _script in pairs(script) do - if not _pattern:startswith("__") and plat:find('^' .. _pattern .. '$') then + local hosts = {} + _pattern = _pattern:gsub("@(.+)", function (v) + -- get and remove hosts for `android@macosx,linux` + for _, host in ipairs(v:split(',')) do + hosts[host] = true + end + return "" + end) + if not _pattern:startswith("__") and pattern:find('^' .. _pattern .. '$') and (#hosts == 0 or hosts[os.host()]) then result = _script break end diff --git a/xmake/platforms/android/xmake.lua b/xmake/platforms/android/xmake.lua index a4985a3eb..04b18db05 100644 --- a/xmake/platforms/android/xmake.lua +++ b/xmake/platforms/android/xmake.lua @@ -28,7 +28,7 @@ platform("android") set_hosts("macosx", "linux", "windows") -- set archs - set_archs("armv5te", "armv7-a", "arm64-v8a", "mips", "mips64", "i386", "x86_64") + set_archs("armv7-a", "arm64-v8a", "armv5te", "mips", "mips64", "i386", "x86_64") -- set formats set_formats {static = "lib$(name).a", object = "$(name).o", shared = "lib$(name).so", symbol = "$(name).sym"} diff --git a/xmake/platforms/iphoneos/xmake.lua b/xmake/platforms/iphoneos/xmake.lua index 899d088e9..83b5fd0c5 100644 --- a/xmake/platforms/iphoneos/xmake.lua +++ b/xmake/platforms/iphoneos/xmake.lua @@ -28,7 +28,7 @@ platform("iphoneos") set_hosts("macosx") -- set archs - set_archs("armv7", "armv7s", "arm64", "i386", "x86_64") + set_archs("arm64", "arm64e", "armv7", "armv7s", "i386", "x86_64") -- set formats set_formats {static = "lib$(name).a", object = "$(name).o", shared = "lib$(name).dylib", symbol = "$(name).sym"} |
