diff options
| author | star9029 <[email protected]> | 2024-12-02 22:53:20 +0800 |
|---|---|---|
| committer | star9029 <[email protected]> | 2024-12-02 22:53:20 +0800 |
| commit | d9bc6250c4cab08285cbeab73293886527098f14 (patch) | |
| tree | a69ff7b0f85a12e5009b76af4c52e61aafbb54ce /xmake/modules/private/tools/ccache.lua | |
| parent | 42934990cefe25d78a98e4314a56f9c8b9b6f281 (diff) | |
Improve ccache tool
Diffstat (limited to 'xmake/modules/private/tools/ccache.lua')
| -rw-r--r-- | xmake/modules/private/tools/ccache.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/xmake/modules/private/tools/ccache.lua b/xmake/modules/private/tools/ccache.lua index 4a877d2b1..12bb0cdd0 100644 --- a/xmake/modules/private/tools/ccache.lua +++ b/xmake/modules/private/tools/ccache.lua @@ -23,18 +23,20 @@ import("core.project.config") import("lib.detect.find_tool") -- get ccache tool -function _ccache() +function get() local ccache = _g.ccache if ccache == nil and config.get("ccache") then ccache = find_tool("ccache") + if not ccache then + ccache = find_tool("sccache") + end _g.ccache = ccache or false end return ccache or nil end --- exists ccache? function exists() - return _ccache() ~= nil + return get() ~= nil end -- uses ccache to wrap the program and arguments @@ -44,7 +46,7 @@ end function cmdargv(program, argv) -- uses ccache? - local ccache = _ccache() + local ccache = get() if ccache then -- parse the filename and arguments, e.g. "xcrun -sdk macosx clang" |
