From f4562609df7ac3f395e5178e76fcefa2c1ffa980 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 26 May 2015 10:19:43 +0800 Subject: probe configure for macosx --- xmake/scripts/platform/platform.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'xmake/scripts/platform/platform.lua') 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 -- cgit v1.3.1