summaryrefslogtreecommitdiff
path: root/xmake/scripts/platform/platform.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/scripts/platform/platform.lua')
-rw-r--r--xmake/scripts/platform/platform.lua29
1 files changed, 29 insertions, 0 deletions
diff --git a/xmake/scripts/platform/platform.lua b/xmake/scripts/platform/platform.lua
index 533026c9c..dc5c9616e 100644
--- a/xmake/scripts/platform/platform.lua
+++ b/xmake/scripts/platform/platform.lua
@@ -207,6 +207,35 @@ function platform.menu(action)
-- get all platform menus
return menus
end
+
+-- probe the platform configure and update the values with "auto"
+function platform.probe(configs, is_global)
+
+ -- probe global
+ if is_global then
+
+ -- get all platforms
+ local plats = platform.plats()
+ assert(plats)
+
+ -- probe all platforms with the current host
+ for _, plat in ipairs(plats) do
+ local p = platform._load(plat)
+ local c = platform._configs(plat)
+ if p and p.probe and c and c.host and c.host == xmake._HOST then
+ p.probe(configs)
+ end
+ end
+
+ -- probe config
+ else
+ -- probe it
+ local p = platform._load(config.get("plat"))
+ if p and p.probe then
+ p.probe(configs)
+ end
+ end
+end
-- return module: platform
return platform