2013-06-11 15:52:19 +00:00
|
|
|
# Set up the environment to build Skia for ChromeOS.
|
2015-04-02 16:27:57 +00:00
|
|
|
###############################################################################
|
|
|
|
# Copyright 2015 Google Inc.
|
|
|
|
#
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
###############################################################################
|
2013-06-11 15:52:19 +00:00
|
|
|
|
|
|
|
function exportVar {
|
|
|
|
NAME=$1
|
|
|
|
VALUE=$2
|
|
|
|
echo export $NAME=\"$VALUE\"
|
|
|
|
export $NAME="$VALUE"
|
|
|
|
}
|
|
|
|
|
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
|
|
|
# Helper function to configure the GYP defines to the appropriate values
|
|
|
|
# based on the target device.
|
|
|
|
setup_device() {
|
|
|
|
# Setup the build variation depending on the target device
|
2013-06-19 15:13:32 +00:00
|
|
|
TARGET_DEVICE="${SDK_BOARD}"
|
2013-06-11 15:52:19 +00:00
|
|
|
|
|
|
|
if [ -z "$TARGET_DEVICE" ]; then
|
2013-06-19 15:13:32 +00:00
|
|
|
echo "ERROR: No target device specified!"
|
|
|
|
return 1
|
2013-06-11 15:52:19 +00:00
|
|
|
fi
|
|
|
|
|
2013-06-25 13:14:38 +00:00
|
|
|
DEFINES="OS=linux host_os=linux skia_os=chromeos skia_gpu=0"
|
2013-06-11 15:52:19 +00:00
|
|
|
|
|
|
|
case $TARGET_DEVICE in
|
2013-06-19 15:13:32 +00:00
|
|
|
link)
|
2015-04-02 16:27:57 +00:00
|
|
|
DEFINES="${DEFINES} skia_arch_type=x86_64"
|
2013-06-19 15:13:32 +00:00
|
|
|
GENERIC_BOARD_TYPE="amd64-generic"
|
2013-06-11 15:52:19 +00:00
|
|
|
;;
|
2013-06-19 15:13:32 +00:00
|
|
|
daisy)
|
2015-04-02 16:27:57 +00:00
|
|
|
# TODO(mtklein): make this arm_version=7 and arm_neon=1
|
|
|
|
DEFINES="${DEFINES} skia_arch_type=arm arm_thumb=0"
|
2013-06-19 15:13:32 +00:00
|
|
|
# TODO(borenet): We have to define skia_warnings_as_errors=0 for the arm
|
|
|
|
# build, which throws lots of "mangling of va_list has changed" warnings.
|
|
|
|
DEFINES="${DEFINES} skia_warnings_as_errors=0"
|
|
|
|
GENERIC_BOARD_TYPE="arm-generic"
|
2013-06-11 15:52:19 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo -n "ERROR: unknown device specified ($TARGET_DEVICE), valid values: "
|
2013-06-19 15:13:32 +00:00
|
|
|
echo "x86-alex link daisy"
|
2013-06-11 15:52:19 +00:00
|
|
|
return 1;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
echo "The build is targeting the device: $TARGET_DEVICE"
|
|
|
|
|
2013-06-19 15:13:32 +00:00
|
|
|
exportVar GENERIC_BOARD_TYPE ${GENERIC_BOARD_TYPE}
|
2013-06-11 15:52:19 +00:00
|
|
|
exportVar GYP_DEFINES "$DEFINES"
|
2014-04-01 07:02:41 +00:00
|
|
|
exportVar GYP_GENERATORS "ninja"
|
2013-06-19 15:13:32 +00:00
|
|
|
exportVar GYP_GENERATOR_FLAGS ""
|
2013-06-11 15:52:19 +00:00
|
|
|
exportVar SKIA_OUT "out/config/chromeos-${TARGET_DEVICE}"
|
2013-06-19 15:13:32 +00:00
|
|
|
exportVar builddir_name "."
|
2013-06-11 15:52:19 +00:00
|
|
|
}
|