summaryrefslogtreecommitdiff
path: root/tools/prebuilt.py
diff options
context:
space:
mode:
authorChristian Moritz <chrmoritz@gmail.com>2019-05-30 00:34:48 +0200
committerRyan Dahl <ry@tinyclouds.org>2019-05-30 13:18:30 -0400
commit0e780e894854cada1244aa3f465c226593187edc (patch)
tree2a047f721e801f3c5c607196c4e997aca3d5e400 /tools/prebuilt.py
parent15dadf812c95c3dd2b93b1ba41ef488baeeac0c1 (diff)
tools/setup: don't download sccache if --no-binary-download is passed
Diffstat (limited to 'tools/prebuilt.py')
-rw-r--r--tools/prebuilt.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/tools/prebuilt.py b/tools/prebuilt.py
index 591cfc664..218ffae3c 100644
--- a/tools/prebuilt.py
+++ b/tools/prebuilt.py
@@ -18,23 +18,22 @@ def download_prebuilt(sha1_file):
env=google_env())
-def load_sccache():
+def get_platform_path(tool):
if sys.platform == 'win32':
- p = "prebuilt/win/sccache.exe"
+ return "prebuilt/win/" + tool + ".exe"
elif sys.platform.startswith('linux'):
- p = "prebuilt/linux64/sccache"
+ return "prebuilt/linux64/" + tool
elif sys.platform == 'darwin':
- p = "prebuilt/mac/sccache"
+ return "prebuilt/mac/" + tool
+
+
+def load_sccache():
+ p = get_platform_path("sccache")
download_prebuilt(p + ".sha1")
return os.path.join(root_path, p)
def load_hyperfine():
- if sys.platform == 'win32':
- p = "prebuilt/win/hyperfine.exe"
- elif sys.platform.startswith('linux'):
- p = "prebuilt/linux64/hyperfine"
- elif sys.platform == 'darwin':
- p = "prebuilt/mac/hyperfine"
+ p = get_platform_path("hyperfine")
download_prebuilt(p + ".sha1")
return os.path.join(root_path, p)