diff options
| -rw-r--r-- | xmake/core/platform/platform.lua | 10 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/import/core/tool/tool.lua | 2 | ||||
| -rw-r--r-- | xmake/core/tool/tool.lua | 3 |
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 |
