diff options
| author | ruki <[email protected]> | 2016-04-28 20:15:09 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-04-28 20:15:09 +0800 |
| commit | 0d9ea7b88dc9cef68c4823bd671fca17d0e4fccf (patch) | |
| tree | 900fb5b15553e6ad60a28505a20aeec291ee9c0e | |
| parent | 3571f65949d94560efbb2ae26703e0f5ac8a5f13 (diff) | |
fix trace for running nmake
| -rw-r--r-- | xmake/core/tool/tool.lua | 5 | ||||
| -rwxr-xr-x | xmake/tools/link.lua | 2 | ||||
| -rw-r--r-- | xmake/tools/nmake.lua | 16 |
3 files changed, 19 insertions, 4 deletions
diff --git a/xmake/core/tool/tool.lua b/xmake/core/tool/tool.lua index 0bbcd9e09..94a11f7ef 100644 --- a/xmake/core/tool/tool.lua +++ b/xmake/core/tool/tool.lua @@ -79,6 +79,9 @@ function tool._find(root, name) -- remove arguments: -xxx or --xxx name = (name:gsub("%s%-+%w+", " ")) + -- remove suffix: ".xxx" + name = (name:gsub("%.%w+", "")) + -- get all tool files local file_ok = nil local score_maxn = 0 @@ -205,7 +208,7 @@ function tool.load(kind) if not shellname then return nil, string.format("cannot get tool for %s", kind) end - + -- load it return tool._load(shellname) end diff --git a/xmake/tools/link.lua b/xmake/tools/link.lua index 7ebbbfc91..4157dd70a 100755 --- a/xmake/tools/link.lua +++ b/xmake/tools/link.lua @@ -85,7 +85,7 @@ function linkdir(dir) end -- make the link command -function linkcmd(srcfile, objfile, flags, logfile) +function linkcmd(objfiles, targetfile, flags, logfile) -- redirect local redirect = "" 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 |
