diff options
| author | ruki <[email protected]> | 2015-06-05 10:18:00 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-06-05 10:18:00 +0800 |
| commit | 12ce7dea3c7a74f77e9792236cb85bab4fd001e4 (patch) | |
| tree | a64fd1ef7c1380ae63e5c982472e8712489b3374 /xmake/scripts/platform/android/prober.lua | |
| parent | f9cecfd11c958122bb6d619069593b91333bdf6f (diff) | |
add ccache
Diffstat (limited to 'xmake/scripts/platform/android/prober.lua')
| -rw-r--r-- | xmake/scripts/platform/android/prober.lua | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/xmake/scripts/platform/android/prober.lua b/xmake/scripts/platform/android/prober.lua index 891023387..e04d49c1e 100644 --- a/xmake/scripts/platform/android/prober.lua +++ b/xmake/scripts/platform/android/prober.lua @@ -45,12 +45,53 @@ function prober._probe_arch(configs) return true end +-- probe the ccache +function prober._probe_ccache(configs) + + -- get the ccache mode + local mode = configs.ccache + + -- ok? + if mode and mode == "y" and configs.__ccache then return true end + + -- disable? + if mode and mode == "n" then + configs.__ccache = nil + return true + end + + -- probe the ccache path + local ccache_path = tools.probe("ccache", {"/usr/bin", "/usr/local/bin", "/opt/bin", "/opt/local/bin"}) + + -- probe ok? update it + if ccache_path then + configs.ccache = "y" + configs.__ccache = ccache_path + else + configs.ccache = "n" + end + + -- ok + return true +end + -- probe the project configure function prober.config(configs) -- probe the architecture if not prober._probe_arch(configs) then return end + -- probe the ccache + if not prober._probe_ccache(configs) then return end + +end + +-- probe the global configure +function prober.global(configs) + + -- probe the ccache + if not prober._probe_ccache(configs) then return end + end -- return module: prober |
