summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2022-05-15 13:34:09 +0800
committerruki <[email protected]>2022-05-15 13:34:09 +0800
commit7130b7d34d42b4f544134b1d0aaa66554be055ec (patch)
tree8399dd65202381e3519e29893a7ee21d8d43a9f7 /xmake/modules
parentba6bd4bba6db46f771e5b24cca0dda113b9caf3a (diff)
get tool info
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/core/tools/gcc.lua2
-rw-r--r--xmake/modules/private/service/distcc_build/client_session.lua7
2 files changed, 6 insertions, 3 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index 0006267a3..523d5fc5e 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -458,7 +458,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags)
-- do compile
local program, argv = compargv(self, sourcefile, objectfile, compflags)
if distcc_build_client.is_distccjob() then
- return distcc_build_client.singleton():iorunv(program, argv, {envs = self:runenvs(), toolname = self:name()})
+ return distcc_build_client.singleton():iorunv(program, argv, {envs = self:runenvs(), tool = self})
else
return os.iorunv(program, argv, {envs = self:runenvs()})
end
diff --git a/xmake/modules/private/service/distcc_build/client_session.lua b/xmake/modules/private/service/distcc_build/client_session.lua
index 749fe9389..2d5c8ec88 100644
--- a/xmake/modules/private/service/distcc_build/client_session.lua
+++ b/xmake/modules/private/service/distcc_build/client_session.lua
@@ -81,7 +81,8 @@ end
function client_session:iorunv(program, argv, opt)
assert(self:is_opened(), "%s: has been not opened!", self)
opt = opt or {}
- local toolname = opt.toolname
+ local tool = opt.tool
+ local toolname = tool:name()
local iorunv = assert(self["_" .. toolname .. "_iorunv"], "%s: iorunv(%s) is not supported!", self, program)
return iorunv(self, program, argv, opt)
end
@@ -134,8 +135,10 @@ function client_session:_gcc_iorunv(program, argv, opt)
-- do compile
local ok = false
local errors
+ local tool = opt.tool
+ local toolname = tool:name()
local stream = self:stream()
- if stream:send_msg(message.new_compile(self:id(), opt.toolname, flags, path.filename(sourcefile), {token = self:token()})) and
+ if stream:send_msg(message.new_compile(self:id(), toolname, flags, path.filename(sourcefile), {token = self:token()})) and
stream:send_file(cppfile, {compress = os.filesize(cppfile) > 4096}) and stream:flush() then
local recv = stream:recv_file(objectfile)
if recv ~= nil then