From 0d9ea7b88dc9cef68c4823bd671fca17d0e4fccf Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 28 Apr 2016 20:15:09 +0800 Subject: fix trace for running nmake --- xmake/tools/nmake.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'xmake/tools/nmake.lua') diff --git a/xmake/tools/nmake.lua b/xmake/tools/nmake.lua index d62b785b0..0badf8df3 100644 --- a/xmake/tools/nmake.lua +++ b/xmake/tools/nmake.lua @@ -49,14 +49,20 @@ function run(makefile, target, jobs) vsenv.enter() -- run command + local ok = -1 if makefile and os.isfile(makefile) then - os.run("%s /nologo /f %s %s VERBOSE=%s", _g.shellname, makefile, target or "", verbose) + ok = os.execute("%s /nologo /f %s %s VERBOSE=%s", _g.shellname, makefile, target or "", verbose) else - os.run("%s /nologo %s VERBOSE=%s", _g.shellname, target or "", verbose) + ok = os.execute("%s /nologo %s VERBOSE=%s", _g.shellname, target or "", verbose) end -- leave vs envirnoment vsenv.leave() + + -- always failed? + if ok ~= 0 then + raise(ok) + end end -- check the given flags @@ -66,9 +72,15 @@ function check(flags) local makefile = path.join(os.tmpdir(), "xmake.checker.nmake") io.write(makefile, "all:\n") + -- enter vs envirnoment + vsenv.enter() + -- check it os.run("%s /nologo %s /f %s", _g.shellname, ifelse(flags, flags, ""), makefile) + -- leave vs envirnoment + vsenv.leave() + -- remove this makefile os.rm(makefile) end -- cgit v1.3.1