summaryrefslogtreecommitdiff
path: root/tools/setup.py
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2018-08-25 13:30:58 +0200
committerBert Belder <bertbelder@gmail.com>2018-08-25 14:16:41 +0200
commit3bcf7e271f775002ba9c010ad79e321a3888187d (patch)
treed590619c229579869dbc6c89ac96d5f3f25b86f1 /tools/setup.py
parentc003df53ab1aba724cdd6a7566302f72d0df97d7 (diff)
Build: make it possible to use ccache/sccache on windows
Also auto-detect the availability of sccache in setup.py.
Diffstat (limited to 'tools/setup.py')
-rwxr-xr-xtools/setup.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/setup.py b/tools/setup.py
index 883270ad1..cc6fef238 100755
--- a/tools/setup.py
+++ b/tools/setup.py
@@ -3,7 +3,7 @@ import third_party
from util import run, build_path, build_mode
import os
import sys
-import distutils.spawn
+from distutils.spawn import find_executable
third_party.fix_symlinks()
third_party.download_gn()
@@ -24,10 +24,15 @@ def get_gn_args():
if "DENO_BUILD_ARGS" in os.environ:
out += os.environ["DENO_BUILD_ARGS"].split()
- # Check if ccache is in the path, and if so we cc_wrapper.
- ccache_path = distutils.spawn.find_executable("ccache")
- if ccache_path:
- out += [r'cc_wrapper="%s"' % ccache_path]
+ # Check if ccache or sccache are in the path, and if so we set cc_wrapper.
+ cc_wrapper = find_executable("ccache") or find_executable("sccache")
+ if cc_wrapper:
+ out += [r'cc_wrapper="%s"' % cc_wrapper]
+ # Windows needs a custom toolchain for cc_wrapper to work.
+ if os.name == "nt":
+ out += [
+ 'custom_toolchain="//build_extra/toolchain/win:win_clang_x64"'
+ ]
print "DENO_BUILD_ARGS:", out