summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2016-07-05 18:09:00 +0800
committerruki <[email protected]>2016-07-05 18:09:00 +0800
commit014f21c729cdab110bcc0a712084c50162f08f39 (patch)
tree62830ce510891c05937d77699458352a6f65c6e9
parent09317b8b9ba669d5d957455e1a658645efbbc2cb (diff)
restore platform.tool
-rw-r--r--xmake/core/platform/platform.lua10
-rw-r--r--xmake/core/sandbox/modules/import/core/tool/tool.lua2
-rw-r--r--xmake/core/tool/tool.lua3
3 files changed, 13 insertions, 2 deletions
diff --git a/xmake/core/platform/platform.lua b/xmake/core/platform/platform.lua
index 5f431d671..bdcf803ad 100644
--- a/xmake/core/platform/platform.lua
+++ b/xmake/core/platform/platform.lua
@@ -319,6 +319,16 @@ function platform.get(name)
end
end
+-- get the platform tool from the kind
+--
+-- .e.g cc, cxx, mm, mxx, as, ar, ld, sh, ..
+--
+function platform.tool(kind)
+
+ -- get it
+ return config.get(kind)
+end
+
-- get the platform archs
function platform.archs(plat)
diff --git a/xmake/core/sandbox/modules/import/core/tool/tool.lua b/xmake/core/sandbox/modules/import/core/tool/tool.lua
index f8df0fcbf..539c9eeb6 100644
--- a/xmake/core/sandbox/modules/import/core/tool/tool.lua
+++ b/xmake/core/sandbox/modules/import/core/tool/tool.lua
@@ -33,7 +33,7 @@ local raise = require("sandbox/modules/raise")
function sandbox_core_tool.shellname(name)
-- get it
- return config.get(name)
+ return platform.tool(name)
end
-- run the tool
diff --git a/xmake/core/tool/tool.lua b/xmake/core/tool/tool.lua
index ec832d781..8126fb1d9 100644
--- a/xmake/core/tool/tool.lua
+++ b/xmake/core/tool/tool.lua
@@ -33,6 +33,7 @@ local filter = require("base/filter")
local config = require("project/config")
local global = require("project/global")
local sandbox = require("sandbox/sandbox")
+local platform = require("platform/platform")
-- the directories of tools
function tool._directories(name)
@@ -228,7 +229,7 @@ end
function tool.load(kind)
-- get the shell name
- local shellname = config.get(kind)
+ local shellname = platform.tool(kind)
if not shellname then
return nil, string.format("cannot get tool for %s", kind)
end