#!/bin/sh # Copyright 2014 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. usage() { cat >&2 <&2; usage || exit;; esac done # Append exra arguments to GYP_DEFINES variable. shift $(( $OPTIND - 1 )) GYP_DEFINES="${GYP_DEFINES} $*" # If you move this script, this must be changed. SKIA_SRC_DIR="$(cd "$(dirname "$0")/../../.."; pwd)" try() { # exit shell script on nonzero return code "$@" local ret=$? if [ $ret != 0 ] ; then echo "'$@' failed and returned ${ret}." >&2 return $ret fi } is_set() { test "$1" && test "$(eval echo \${$1})"; } # Set a reasonable default. is_set SKIA_OUT || export SKIA_OUT="${SKIA_SRC_DIR}/out/barelinux" # Assume ninja is in your path try command -v ninja > /dev/null || exit try test -x "${SKIA_SRC_DIR}/gyp_skia" || exit try mkdir -p "$SKIA_OUT" || exit export GYP_GENERATORS="ninja" export GYP_GENERATOR_FLAGS="" export GYP_DEFINES="${GYP_DEFINES} \ skia_warnings_as_errors=0 \ skia_giflib_static=1 \ skia_libpng_static=1 \ skia_zlib_static=1 \ skia_freetype_static=1 \ skia_no_fontconfig=1 \ skia_poppler_enabled=0 \ skia_skip_gui=1 \ " try "${SKIA_SRC_DIR}/gyp_skia" || exit try test -d "${SKIA_OUT}/${BUILD_TYPE}" || exit try ninja -C "${SKIA_OUT}/${BUILD_TYPE}" || exit