summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/nvcc.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-08-22 23:53:17 +0800
committerruki <[email protected]>2019-08-22 17:19:43 +0800
commit9504fe2932ff188662d3b4e05fb9de8782790bf3 (patch)
tree988300147245d08de6af1cc4deb90ed20951ba26 /xmake/modules/core/tools/nvcc.lua
parent7de70265488ff014e4a54c5538d602eda422a862 (diff)
fix nvcc raise errors
Diffstat (limited to 'xmake/modules/core/tools/nvcc.lua')
-rw-r--r--xmake/modules/core/tools/nvcc.lua7
1 files 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