1#!/bin/bash 2# Copyright 2018 Google LLC 3# 4# Use of this source code is governed by a BSD-style license that can be 5# found in the LICENSE file. 6 7# This assumes it is being run inside a docker container of emsdk-base 8# and a Skia checkout has been mounted at /SRC and the output directory 9# is mounted at /OUT 10 11set +e 12set -x 13# Clean out previous builds (ignoring any errors for things like folders) 14# (e.g. we don't want to delete /OUT/depot_tools/) 15rm -f /OUT/* 16# We want to clean out previously generated code and object files to avoid 17# previous builds contaminating this one. 18rm -rf /OUT/gen 19rm -rf /OUT/obj 20set -e 21 22#BASE_DIR is the dir this script is in ($SKIA_ROOT/infra/canvaskit) 23BASE_DIR=`cd $(dirname ${BASH_SOURCE[0]}) && pwd` 24CANVASKIT_DIR=$BASE_DIR/../../modules/canvaskit 25 26BUILD_DIR=/OUT $CANVASKIT_DIR/compile.sh $@ 27 28chmod -R 0777 /OUT/* 29