diff options
Diffstat (limited to 'xmake/tools/nmake.lua')
| -rw-r--r-- | xmake/tools/nmake.lua | 16 |
1 files changed, 14 insertions, 2 deletions
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 |
