From 9504fe2932ff188662d3b4e05fb9de8782790bf3 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 22 Aug 2019 23:53:17 +0800 Subject: fix nvcc raise errors --- xmake/modules/core/tools/nvcc.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xmake/modules/core/tools/nvcc.lua b/xmake/modules/core/tools/nvcc.lua index ecbfe14f0..a4393d994 100644 --- a/xmake/modules/core/tools/nvcc.lua +++ b/xmake/modules/core/tools/nvcc.lua @@ -321,9 +321,9 @@ function _compile1(self, sourcefile, objectfile, dependinfo, flags) -- generate includes file if depfile and _g._HAS_M_MF then - local compflags = table.join(flags, "-M", "-MF", depfile) -- since -MD is not supported, run nvcc twice - os.iorunv(_compargv1(self, sourcefile, objectfile, compflags)) + local compflags = table.join(flags, "-M", "-MF", depfile) + os.runv(_compargv1(self, sourcefile, objectfile, compflags)) end local outdata, errdata = os.iorunv(_compargv1(self, sourcefile, objectfile, flags)) @@ -337,7 +337,8 @@ function _compile1(self, sourcefile, objectfile, dependinfo, flags) os.tryrm(objectfile) -- find the start line of error - local lines = tostring(errors):split("\n", {plain = true}) + errors = tostring(errors) + local lines = errors:split("\n", {plain = true}) local start = 0 for index, line in ipairs(lines) do if line:find("error:", 1, true) or line:find("错误:", 1, true) then -- cgit v1.3.1