diff options
| author | ruki <[email protected]> | 2017-11-09 22:41:13 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-11-09 10:07:18 +0800 |
| commit | aa332adff92a4d51ec02b884276cded3ba9ec83c (patch) | |
| tree | 46476171b7a637504dd1871dcfb9b51de548cfbe /xmake/core/platform/platform.lua | |
| parent | 31b1517d8303402f34f70fec8a7d6d644b1a10db (diff) | |
improve to configure cross-toolchains
Diffstat (limited to 'xmake/core/platform/platform.lua')
| -rw-r--r-- | xmake/core/platform/platform.lua | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/xmake/core/platform/platform.lua b/xmake/core/platform/platform.lua index 9b546fad7..e23946515 100644 --- a/xmake/core/platform/platform.lua +++ b/xmake/core/platform/platform.lua @@ -243,9 +243,7 @@ function platform.tool(toolkind) -- attempt to get program from config first local program = config.get(toolkind) - if program then - return program - else + if program == nil then -- check it first local check = platform.get("check") @@ -254,8 +252,21 @@ function platform.tool(toolkind) end -- get it again - return config.get(toolkind) + program = config.get(toolkind) end + + -- contain toolname? parse it, .e.g '[email protected]' + local toolname = nil + if program then + local pos = program:find('@', 1, true) + if pos then + toolname = program:sub(1, pos - 1) + program = program:sub(pos + 1) + end + end + + -- ok + return program, toolname end -- get the all platforms |
