diff options
| author | ruki <[email protected]> | 2015-06-01 10:03:16 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-06-01 10:09:10 +0800 |
| commit | 7381a36a64f50a6db22155ebce996351201b90cb (patch) | |
| tree | fea64527b0cf27c3d00691752ceca2a678546646 /xmake/scripts/platform/platform.lua | |
| parent | a32ad41a1812ad88043c0ecd0a09301267de9871 (diff) | |
add linker and make link command
Diffstat (limited to 'xmake/scripts/platform/platform.lua')
| -rw-r--r-- | xmake/scripts/platform/platform.lua | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/xmake/scripts/platform/platform.lua b/xmake/scripts/platform/platform.lua index 920aeab14..57f50576c 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 linker = require("linker/linker") local compiler = require("compiler/compiler") -- load the given platform @@ -86,18 +87,38 @@ function platform.get(name) end end --- get the format from the given kind -function platform.format(kind) +-- get the filename from the given name and kind +function platform.filename(name, kind) -- check - assert(kind) + assert(name and kind) + + -- get formats + local formats = platform.get("format") + assert(formats) -- get format - local format = platform.get("format") - assert(format) + local format = formats[kind] or {"", ""} + + -- make it + return format[1] .. name .. format[2] +end + +-- get the linker from the given name +function platform.linker(name) + + -- check + assert(name) + + -- get linker + local c = platform.get("linker") + assert(c) - -- get it - return format[kind] or {"", ""} + -- load linker + c = c[name] + if c then + return linker.load(c) + end end -- get the compiler from the given name |
