summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/yasm.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-02-13 22:33:06 +0800
committerruki <[email protected]>2019-02-13 09:18:37 +0800
commite6b1a84a210d20f69f9987054c21ab64157f77d9 (patch)
treeb90e39f8106e968029267471ce252dbbfbf9d44a /xmake/modules/core/tools/yasm.lua
parent1d0218df9840b90c387f8c94ca2166feb07a8385 (diff)
show warning for yasm
Diffstat (limited to 'xmake/modules/core/tools/yasm.lua')
-rw-r--r--xmake/modules/core/tools/yasm.lua34
1 files changed, 33 insertions, 1 deletions
diff --git a/xmake/modules/core/tools/yasm.lua b/xmake/modules/core/tools/yasm.lua
index 303074f0c..7b12c61f1 100644
--- a/xmake/modules/core/tools/yasm.lua
+++ b/xmake/modules/core/tools/yasm.lua
@@ -22,6 +22,9 @@
-- @file yasm.lua
--
+-- imports
+import("core.base.option")
+
-- init it
function init(self)
@@ -92,7 +95,36 @@ function _compile1(self, sourcefile, objectfile, dependinfo, flags)
os.mkdir(path.directory(objectfile))
-- compile it
- os.runv(_compargv1(self, sourcefile, objectfile, flags))
+ local outdata, errdata = try
+ {
+ function ()
+ return os.iorunv(_compargv1(self, sourcefile, objectfile, flags))
+ end,
+ catch
+ {
+ function (errors)
+
+ -- try removing the old object file for forcing to rebuild this source file
+ os.tryrm(objectfile)
+
+ -- raise compiling errors
+ raise(errors)
+ end
+ },
+ finally
+ {
+ function (ok, outdata, errdata)
+
+ -- show warnings?
+ if ok and errdata and (option.get("diagnosis") or option.get("warning")) then
+ errdata = errdata:trim()
+ if #errdata > 0 then
+ cprint("${color.warning}%s", errdata)
+ end
+ end
+ end
+ }
+ }
end
-- make the complie arguments list