aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/skqp/generate_gn_args.sh
blob: 8d12fa8513e6ed1e931fa8048e12e5f522f83f9c (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
#! /bin/sh

# Copyright 2018 Google Inc.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

BUILD="$1"
ANDROID_NDK="$2"
ARCH="$3"

if [ $# -ne 3 ] || [ -z "$BUILD" ] || ! [ -d "$ANDROID_NDK" ] || [ -z "$ARCH" ]; then
    printf 'Usage:\n  %s TARGET_BUILD_DIR ANDROID_NDK_DIR ARCHITECTURE\n\n' "$0" >&2
    printf 'ARCHITECTURE should be "arm" "arm64" "x86" or "x64"\n\n' >&2
    exit 1
fi

ANDROID_NDK="$(cd "$ANDROID_NDK"; pwd)"

mkdir -p "$BUILD"

cat > "$BUILD/args.gn" << EOF
ndk = "$ANDROID_NDK"
ndk_api = 26
target_cpu = "$ARCH"
skia_embed_resources = true
is_debug = false
skia_enable_pdf = false
EOF