From cab3fb99fdc5a4a9fd97437cf4ed8a232a12ebc9 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 8 May 2021 16:01:27 +0800 Subject: improve nvcc --- xmake/modules/core/tools/nvcc.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'xmake/modules/core/tools/nvcc.lua') diff --git a/xmake/modules/core/tools/nvcc.lua b/xmake/modules/core/tools/nvcc.lua index 011599e8a..df4a6b7f4 100644 --- a/xmake/modules/core/tools/nvcc.lua +++ b/xmake/modules/core/tools/nvcc.lua @@ -317,12 +317,14 @@ function compile(self, sourcefile, objectfile, dependinfo, flags) compflags = table.join(compflags, "-MMD", "-MF", depfile) elseif _has_flags_mm(self) then -- since -MD is not supported, run nvcc twice - os.runv(compargv(self, sourcefile, depfile, table.join(flags, "-MM"))) + local program, argv = compargv(self, sourcefile, depfile, table.join(flags, "-MM")) + os.runv(program, argv, {envs = self:runenvs()}) end end -- do compile - local outdata, errdata = os.iorunv(compargv(self, sourcefile, objectfile, compflags)) + local program, argv = compargv(self, sourcefile, objectfile, compflags) + local outdata, errdata = os.iorunv(program, argv, {envs = self:runenvs()}) return (outdata or "") .. (errdata or "") end, catch -- cgit v1.3.1