summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-08-30 23:59:42 +0800
committerruki <[email protected]>2019-08-30 17:58:15 +0800
commitb58574872f3475ac541580ba29068a790a63ecaf (patch)
tree1f5775a270e49833c83675bd18b27aab38a08990
parent74108f9a690cab1a9a8749e5e1c6880d59c83c95 (diff)
add private ccache tools
-rw-r--r--xmake/modules/private/tools/ccache.lua38
1 files changed, 38 insertions, 0 deletions
diff --git a/xmake/modules/private/tools/ccache.lua b/xmake/modules/private/tools/ccache.lua
new file mode 100644
index 000000000..d08b78d2b
--- /dev/null
+++ b/xmake/modules/private/tools/ccache.lua
@@ -0,0 +1,38 @@
+--!A cross-platform build utility based on Lua
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+-- Copyright (C) 2015 - 2019, TBOOX Open Source Group.
+--
+-- @author ruki
+-- @file ccache.lua
+--
+
+-- imports
+import("lib.detect.find_tool")
+
+-- get ccache tool
+function _ccache()
+ local ccache = _g.ccache
+ if ccache == nil then
+ ccache = find_tool("ccache")
+ _g.ccache = ccache or false
+ end
+ return ccache or nil
+end
+
+-- exists ccache?
+function exists()
+ return _ccache() ~= nil
+end
+