summaryrefslogtreecommitdiff
path: root/xmake/tools/nmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2016-04-28 20:15:09 +0800
committerruki <[email protected]>2016-04-28 20:15:09 +0800
commit0d9ea7b88dc9cef68c4823bd671fca17d0e4fccf (patch)
tree900fb5b15553e6ad60a28505a20aeec291ee9c0e /xmake/tools/nmake.lua
parent3571f65949d94560efbb2ae26703e0f5ac8a5f13 (diff)
fix trace for running nmake
Diffstat (limited to 'xmake/tools/nmake.lua')
-rw-r--r--xmake/tools/nmake.lua16
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