Setup build remoteexec param

Compiling is about 50x faster with remoteexec. I tend to clean the out
folder as part of my workflow so this will help me avoid waiting for
builds.

Change-Id: I353f1a8bc352a2b2ec4c7f6228f43ba11d12be5c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/211374
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Peter McNeeley <petermcneeley@google.com>
diff --git a/tools/setup-build b/tools/setup-build
index cc08a44..f9cd66c 100755
--- a/tools/setup-build
+++ b/tools/setup-build
@@ -41,6 +41,7 @@
 BUILD_ARCH=""
 FORCE=""
 VERBOSE=""
+REMOTEEXEC=""
 
 function show_usage() {
   echo "setup-build [-f] $POSSIBLE_BUILD_SYSTEMS $POSSIBLE_BUILD_TYPES $POSSIBLE_BUILD_ARCHS [fuzz|fuzzer]"
@@ -60,6 +61,7 @@
   echo "  fuzz, fuzzer  Build fuzzers. Forces Clang to be used"
   echo "  native        Target the machine you're running on"
   echo "  x86           Target a 32-bit x86 (adds -m32 to compiler flags)"
+  echo "  remoteexec    Use remoteexec to improve compile time"
   if [[ ! -z "$1" ]]; then
     echo
     echo "$1"
@@ -120,6 +122,9 @@
     "--verbose" | "-v")
       VERBOSE=1
     ;;
+    "remoteexec")
+      REMOTEEXEC=1
+    ;;
     "--help" | "-help" | "-h")
       show_usage
     ;;
@@ -185,6 +190,9 @@
         GN_ARGS+=" tint_build_ir_binary=true"
         GN_ARGS+=" tint_build_ir_fuzzer=true"
     fi
+    if [[ -n "$REMOTEEXEC" ]]; then
+        GN_ARGS+=" use_remoteexec=true"
+    fi
     if [[ -z "$FORCE" && -f "$ROOT_DIR/out/$BUILD_DIR/args.gn" ]]; then
       generate "gn" "gen" "out/active" # keep existing args
     else