summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxq114 <[email protected]>2022-01-16 18:12:11 +0800
committerxq114 <[email protected]>2022-01-16 18:12:11 +0800
commitd72235dfae52bb49d2d53dbae8ffdfffd270f73a (patch)
tree29adaf8ed31bd3f9ec1fbd0882f84961ff90263b
parentbd508b6fb1cf41646525950b6f02bfccc5b540e3 (diff)
improve nvcc.lua
-rw-r--r--xmake/modules/core/tools/nvcc.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/xmake/modules/core/tools/nvcc.lua b/xmake/modules/core/tools/nvcc.lua
index 2aad54096..471d62532 100644
--- a/xmake/modules/core/tools/nvcc.lua
+++ b/xmake/modules/core/tools/nvcc.lua
@@ -352,7 +352,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags)
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
+ if line:find("error:", 1, true) or line:find("错误:", 1, true) or line:match("ptxas fatal%s*:") or line:match("error %a+[0-9]+%s*:") then
start = index
break
end
@@ -363,6 +363,9 @@ function compile(self, sourcefile, objectfile, dependinfo, flags)
if start == 0 then start = 1 end
errors = table.concat(table.slice(lines, start, start + ((#lines - start > 16) and 16 or (#lines - start))), "\n")
end
+ if not option.get("verbose") then
+ errors = errors .. "\n ${yellow}> in ${bright}" .. sourcefile
+ end
-- raise compiling errors
raise(errors)