diff options
| author | ruki <[email protected]> | 2015-05-30 15:18:19 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-05-30 15:18:19 +0800 |
| commit | 87683f4d3ba6d41c0b8900244e05dee4f84e2e62 (patch) | |
| tree | 43829a15b7bf2e7311302af6d826408bcdbad38d /xmake/scripts/platform/platform.lua | |
| parent | 9aa34cbeaac0f6117fc0879a4f5f7059438da3c1 (diff) | |
load compiler and make command
Diffstat (limited to 'xmake/scripts/platform/platform.lua')
| -rw-r--r-- | xmake/scripts/platform/platform.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/xmake/scripts/platform/platform.lua b/xmake/scripts/platform/platform.lua index 064138d45..920aeab14 100644 --- a/xmake/scripts/platform/platform.lua +++ b/xmake/scripts/platform/platform.lua @@ -28,6 +28,7 @@ local os = require("base/os") local path = require("base/path") local utils = require("base/utils") local config = require("base/config") +local compiler = require("compiler/compiler") -- load the given platform function platform._load(plat) @@ -88,13 +89,34 @@ end -- get the format from the given kind function platform.format(kind) + -- check + assert(kind) + -- get format local format = platform.get("format") + assert(format) -- get it return format[kind] or {"", ""} end +-- get the compiler from the given name +function platform.compiler(name) + + -- check + assert(name) + + -- get compiler + local c = platform.get("compiler") + assert(c) + + -- load compiler + c = c[name] + if c then + return compiler.load(c) + end +end + -- dump the platform configure function platform.dump() |
