From f5039b99e02b232e3394687c8141c713064368b1 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 22 Jul 2021 00:53:27 +0800 Subject: improve configs --- xmake/actions/config/xmake.lua | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/xmake/actions/config/xmake.lua b/xmake/actions/config/xmake.lua index 4ec09380f..de60a2a3b 100644 --- a/xmake/actions/config/xmake.lua +++ b/xmake/actions/config/xmake.lua @@ -84,9 +84,16 @@ task("config") import("core.project.project") import("core.platform.platform") + -- get all platforms + local plats = try {function () return project.allowed_plats() end} + if plats then + plats = plats:to_array() + end + plats = plats or platform.plats() + -- get all architectures local description = {} - for i, plat in ipairs(platform.plats()) do + for i, plat in ipairs(plats) do local archs = try {function () return project.allowed_archs(plat) end} if archs then archs = archs:to_array() @@ -115,9 +122,16 @@ task("config") import("core.platform.platform") import("core.base.hashset") + -- get all platforms + local plats = try {function () return project.allowed_plats() end} + if plats then + plats = plats:to_array() + end + plats = plats or platform.plats() + -- get all architectures local archset = hashset.new() - for _, plat in ipairs(opt.plat and { opt.plat } or platform.plats()) do + for _, plat in ipairs(opt.plat and { opt.plat } or plats) do local archs = try {function () return project.allowed_archs(plat) end} if archs then archs = archs:to_array() -- cgit v1.3.1