diff options
| author | ruki <[email protected]> | 2015-05-26 10:19:43 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-05-26 10:19:43 +0800 |
| commit | f4562609df7ac3f395e5178e76fcefa2c1ffa980 (patch) | |
| tree | 526caad47b590de1be57996ee19b28d4e34d082a /xmake/scripts/platform/platform.lua | |
| parent | 49ae120e090b2d4dd15e486ade2dfc2ea1ded440 (diff) | |
probe configure for macosx
Diffstat (limited to 'xmake/scripts/platform/platform.lua')
| -rw-r--r-- | xmake/scripts/platform/platform.lua | 29 |
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 |
