diff options
| author | ruki <[email protected]> | 2016-05-05 16:27:19 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-05-05 16:27:19 +0800 |
| commit | 71b2d410636677bcc7b4ea9b9c637a13414ee1cf (patch) | |
| tree | c2cba7e0c387850608c033f8b60964f2e743576b | |
| parent | 64cf81d6ddf726e3230b4fab852e4eb0b75c378d (diff) | |
fix ccache check bug
| -rw-r--r-- | xmake/platforms/checker.lua | 4 | ||||
| -rw-r--r-- | xmake/tools/ccache.lua | 50 |
2 files changed, 52 insertions, 2 deletions
diff --git a/xmake/platforms/checker.lua b/xmake/platforms/checker.lua index bcacbdfa0..a6fa308e7 100644 --- a/xmake/platforms/checker.lua +++ b/xmake/platforms/checker.lua @@ -175,9 +175,9 @@ end -- check the ccache function check_ccache(config) - -- ok? + -- get the ccache local ccache = config.get("ccache") - if ccache ~= nil then + if ccache == nil then -- check the ccache path local ccache_path = tool.check("ccache", {"/usr/bin", "/usr/local/bin", "/opt/bin", "/opt/local/bin"}) diff --git a/xmake/tools/ccache.lua b/xmake/tools/ccache.lua new file mode 100644 index 000000000..cd91dba0d --- /dev/null +++ b/xmake/tools/ccache.lua @@ -0,0 +1,50 @@ +--!The Automatic Cross-platform Build Tool +-- +-- XMake is free software; you can redistribute it and/or modify +-- it under the terms of the GNU Lesser General Public License as published by +-- the Free Software Foundation; either version 2.1 of the License, or +-- (at your option) any later version. +-- +-- XMake is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public License +-- along with XMake; +-- If not, see <a href="http://www.gnu.org/licenses/"> http://www.gnu.org/licenses/</a> +-- +-- Copyright (C) 2015 - 2016, ruki All rights reserved. +-- +-- @author ruki +-- @file ccache.lua +-- + +-- init it +function init(shellname) + + -- save name + _g.shellname = shellname or "ccache" + +end + +-- get the property +function get(name) + + -- get it + return _g[name] +end + +-- run it +function run(...) + + -- run it + os.run(...) +end + +-- check the given flags +function check(flags) + + -- check it + os.run("%s %s -h", _g.shellname, ifelse(flags, flags, "")) +end |
