diff options
| author | ruki <[email protected]> | 2016-04-19 14:33:09 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-04-19 14:33:09 +0800 |
| commit | 655f4fc9f27d19bb02eb6f131412f88db42f4253 (patch) | |
| tree | 6b6bf66f8ab80c8c29e28bbbb08b175cc97303ae /xmake/tools | |
| parent | 223c87f37fb9e8f3ffe808fae5041a1c4aee95d0 (diff) | |
check ar and swiftc
Diffstat (limited to 'xmake/tools')
| -rw-r--r-- | xmake/tools/ar.lua | 5 | ||||
| -rw-r--r-- | xmake/tools/swiftc.lua | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/xmake/tools/ar.lua b/xmake/tools/ar.lua index 0999672f1..9aaf70b80 100644 --- a/xmake/tools/ar.lua +++ b/xmake/tools/ar.lua @@ -68,5 +68,8 @@ end function check(flags) -- check it - os.run("%s %s", _g.shellname, ifelse(flags, flags, "")) + local ok = os.execute("%s %s > %s 2>&1", _g.shellname, ifelse(flags, flags, ""), os.nuldev()) + if ok ~= 0 and ok ~= 256 then + raise("not found!") + end end diff --git a/xmake/tools/swiftc.lua b/xmake/tools/swiftc.lua index 65e6f8245..2cfc94cc0 100644 --- a/xmake/tools/swiftc.lua +++ b/xmake/tools/swiftc.lua @@ -110,3 +110,10 @@ function run(...) os.run(...) end +-- check the given flags +function check(flags) + + -- check it + os.run("%s -h", _g.shellname) + +end |
