summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-07-22 00:53:27 +0800
committerruki <[email protected]>2021-07-22 00:53:27 +0800
commitf5039b99e02b232e3394687c8141c713064368b1 (patch)
tree409411d019c45bc44a02a448ed9a942b4d696371
parent6fa4312e9b74fd49450c693502a4b72f72f3e886 (diff)
improve configs
-rw-r--r--xmake/actions/config/xmake.lua18
1 files 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()