summaryrefslogtreecommitdiff
path: root/scripts/build-d8.sh
blob: 13b043d9209eb21746811c1ed3c409d57e47bb0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
set -o nounset
set -o errexit

config=Release

while [[ $# > 0 ]]; do
  flag="$1"
  case $flag in
    --debug)
      config=Debug
      ;;
    *)
      echo "unknown arg ${flag}"
      ;;
  esac
  shift
done

SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
ROOT_DIR="$(dirname "${SCRIPT_DIR}")"

cd ${ROOT_DIR}/third_party/v8

if [[ ! -d depot_tools ]]; then
  echo "Cloning depot_tools"
  git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
fi

export PATH=$PWD/depot_tools:$PATH
gclient sync

# Don't use the CC from the environment; v8 doesn't seem to build properly with
# it.
unset CC
cd v8
GYP_GENERATORS=ninja build/gyp_v8 -Dv8_wasm=1
time ninja -C out/${config} d8