|
@@ -41,7 +41,7 @@ function get_target(package)
|
|
|
local arch = package:targetarch()
|
|
|
if arch:startswith("arm64") then
|
|
|
arch = "arm64"
|
|
|
- elseif arch == "armeabi-v7a" then
|
|
|
+ elseif arch == "armeabi-v7a" or arch == "arm" then
|
|
|
arch = "armv7"
|
|
|
elseif arch == "x64" then
|
|
|
arch = "x86_64"
|
|
@@ -63,7 +63,7 @@ function get_target(package)
|
|
|
end
|
|
|
|
|
|
local cc = path.basename(compiler.compcmd("foo.c")):split(" ", {plain = true})[1]:lower()
|
|
|
- if cc == "clang" or cc == "emcc" then
|
|
|
+ if cc == "clang" or cc == "emcc" or cc:endswith("-gcc") then
|
|
|
cc = "gcc"
|
|
|
elseif cc == "cl" then
|
|
|
cc = "vs"
|
|
@@ -72,12 +72,12 @@ function get_target(package)
|
|
|
local matched_plats
|
|
|
matched_plats = _filter(platforms, function (p) return p[1] == arch end)
|
|
|
local tmp = _filter(matched_plats, function (p) return p[2] == os end)
|
|
|
- matched_plats = #tmp == 0 and _filter(matched_plats, function (p) return p[2]:startswith(plat) end) or tmp
|
|
|
+ matched_plats = #tmp == 0 and _filter(matched_plats, function (p) return p[2] and p[2]:startswith(os) end) or tmp
|
|
|
tmp = nil
|
|
|
if #matched_plats == 0 then
|
|
|
- cprint("${yellow}warning: ${clear}no matching platform for " .. os .. "-" .. arch .. " " .. cc .. ", use " .. default_plat)
|
|
|
+ cprint("${yellow}warning: ${clear}no matching platform for ${blue}" .. os .. " " .. arch .. " " .. cc .. "${clear}, use " .. default_plat)
|
|
|
end
|
|
|
- local result = _join(_find(platforms, function(p) return p[3] == cc end) or _find(platforms, function(p) return p[3]:startswith(cc) end) or platforms[1], "-")
|
|
|
+ local result = _join(_find(platforms, function(p) return p[3] == cc end) or _find(platforms, function(p) return p[3] and p[3]:startswith(cc) end) or matched_plats[1], "-")
|
|
|
cprint("${green}info: ${clear}use target platform ${blue}" .. result .. "${clear}")
|
|
|
return result
|
|
|
end
|