diff options
| -rw-r--r-- | xmake/modules/private/service/distcc_build/server_session.lua | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/xmake/modules/private/service/distcc_build/server_session.lua b/xmake/modules/private/service/distcc_build/server_session.lua index f45d9acf0..884f47c3b 100644 --- a/xmake/modules/private/service/distcc_build/server_session.lua +++ b/xmake/modules/private/service/distcc_build/server_session.lua @@ -100,7 +100,8 @@ function server_session:compile(respmsg) function () local flags = body.flags local toolname = body.toolname - os.vrunv(toolname, table.join(flags, "-o", objectfile, sourcefile)) + local compile = assert(self["_" .. toolname .. "_compile"], "%s: compiler(%s) is not supported!", self, toolname) + compile(self, toolname, flags, sourcefile, objectfile, body) return os.isfile(objectfile) end, catch @@ -172,6 +173,26 @@ function server_session:statusfile() return path.join(self:workdir(), "status.txt") end +-- do compile job for gcc +function server_session:_gcc_compile(toolname, flags, sourcefile, objectfile, opt) + os.vrunv(toolname, table.join(flags, "-o", objectfile, sourcefile)) +end + +-- do compile job for g++ +function server_session:_gxx_compile(toolname, flags, sourcefile, objectfile, opt) + return self:_gcc_compile(toolname, flags, sourcefile, objectfile, opt) +end + +-- do compile job for clang +function server_session:_clang_compile(toolname, flags, sourcefile, objectfile, opt) + return self:_gcc_compile(toolname, flags, sourcefile, objectfile, opt) +end + +-- do compile job for clang++ +function server_session:_clangxx_compile(toolname, flags, sourcefile, objectfile, opt) + return self:_gcc_compile(toolname, flags, sourcefile, objectfile, opt) +end + function server_session:__tostring() return string.format("<session %s>", self:id()) end |
