|
|
|
@ -110,14 +110,17 @@ function _require_packages(argv, packages) |
|
|
|
|
end |
|
|
|
|
os.vexecv("xmake", config_argv) |
|
|
|
|
local require_argv = {"require", "-f", "-y"} |
|
|
|
|
local check_argv = {"require", "-f", "-y", "--check"} |
|
|
|
|
if not argv.precompiled then |
|
|
|
|
table.insert(require_argv, "--build") |
|
|
|
|
end |
|
|
|
|
if argv.verbose then |
|
|
|
|
table.insert(require_argv, "-v") |
|
|
|
|
table.insert(check_argv, "-v") |
|
|
|
|
end |
|
|
|
|
if argv.diagnosis then |
|
|
|
|
table.insert(require_argv, "-D") |
|
|
|
|
table.insert(check_argv, "-D") |
|
|
|
|
end |
|
|
|
|
local is_debug = false |
|
|
|
|
if argv.debugdir then |
|
|
|
@ -157,8 +160,20 @@ function _require_packages(argv, packages) |
|
|
|
|
end |
|
|
|
|
local extra_str = string.serialize(extra, {indent = false, strip = true}) |
|
|
|
|
table.insert(require_argv, "--extra=" .. extra_str) |
|
|
|
|
table.join2(require_argv, packages) |
|
|
|
|
os.vexecv("xmake", require_argv) |
|
|
|
|
table.insert(check_argv, "--extra=" .. extra_str) |
|
|
|
|
|
|
|
|
|
local install_packages = {} |
|
|
|
|
for _, package in ipairs(packages) do |
|
|
|
|
local ok = os.vexecv("xmake", table.join(check_argv, package), {try = true}) |
|
|
|
|
if ok == 0 then |
|
|
|
|
table.insert(install_packages, package) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
if #install_packages > 0 then |
|
|
|
|
os.vexecv("xmake", table.join(require_argv, install_packages)) |
|
|
|
|
else |
|
|
|
|
print("no testable packages on %s or you're using lower version xmake!", argv.plat or os.subhost()) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
-- the given package is supported? |
|
|
|
|