summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/ml.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-03-16 23:41:46 +0800
committerruki <[email protected]>2020-03-16 16:10:41 +0800
commiteab12862d905574ada90a75af8ccf246be152ea4 (patch)
tree509bd30246119c5f8900ac15971b25aa19388834 /xmake/modules/core/tools/ml.lua
parent83d289acd55263bce45a3d3ebe389b84bdd27a1f (diff)
fix link errors output
Diffstat (limited to 'xmake/modules/core/tools/ml.lua')
-rw-r--r--xmake/modules/core/tools/ml.lua24
1 files changed, 22 insertions, 2 deletions
diff --git a/xmake/modules/core/tools/ml.lua b/xmake/modules/core/tools/ml.lua
index 2c67ef740..24ee3ecab 100644
--- a/xmake/modules/core/tools/ml.lua
+++ b/xmake/modules/core/tools/ml.lua
@@ -101,8 +101,28 @@ function _compile1(self, sourcefile, objectfile, dependinfo, flags)
-- ensure the object directory
os.mkdir(path.directory(objectfile))
- -- use vstool to compile and enable vs_unicode_output @see https://github.com/xmake-io/xmake/issues/528
- vstool.runv(_compargv1(self, sourcefile, objectfile, flags))
+ try
+ {
+ function ()
+ -- use vstool to compile and enable vs_unicode_output @see https://github.com/xmake-io/xmake/issues/528
+ vstool.runv(_compargv1(self, sourcefile, objectfile, flags))
+ end,
+ catch
+ {
+ function (errors)
+
+ -- use link/stdout as errors first from vstool.iorunv()
+ if type(errors) == "table" then
+ local errs = errors.stdout or ""
+ if #errs:trim() == 0 then
+ errs = errors.stderr or ""
+ end
+ errors = errs
+ end
+ os.raise(tostring(errors))
+ end
+ }
+ }
end
-- make the compile arguments list