summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-11-16 22:46:17 +0800
committerruki <[email protected]>2021-11-16 22:46:17 +0800
commitdce21455e0aead37e5115c820bc1f23f61b738eb (patch)
treeba68ac9d9348030db1ab65d951498eaec6f20b77
parentbf6635bb416c380091d1d6ef14bdf31e28049085 (diff)
improve compile errors
-rw-r--r--xmake/modules/core/tools/cl.lua5
-rw-r--r--xmake/modules/core/tools/gcc.lua7
2 files changed, 10 insertions, 2 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua
index 7bbb6ff8b..c4cf109bf 100644
--- a/xmake/modules/core/tools/cl.lua
+++ b/xmake/modules/core/tools/cl.lua
@@ -454,7 +454,10 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt)
end
end
end
- os.raise(results)
+ if not option.get("verbose") then
+ results = results .. "\n ${yellow}> in ${bright}" .. sourcefile
+ end
+ raise(results)
end
},
finally
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index 240ec2855..a871f62e5 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -494,7 +494,12 @@ function compile(self, sourcefile, objectfile, dependinfo, flags)
end
-- raise compiling errors
- raise(#lines > 0 and table.concat(lines, "\n") or "")
+ local results = #lines > 0 and table.concat(lines, "\n") or ""
+ if not option.get("verbose") then
+ results = results .. "\n ${yellow}> in ${bright}" .. sourcefile
+ end
+ raise(results)
+
end
},
finally