Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Side by Side Diff: platform_tools/android/bin/android_setup.sh

Issue 1930423002: Require Android SDK copy of CMake to build Vulkan on Android. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « DEPS ('k') | tools/build_shaderc.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 ############################################################################### 2 ###############################################################################
3 # Copyright 2015 Google Inc. 3 # Copyright 2015 Google Inc.
4 # 4 #
5 # Use of this source code is governed by a BSD-style license that can be 5 # Use of this source code is governed by a BSD-style license that can be
6 # found in the LICENSE file. 6 # found in the LICENSE file.
7 ############################################################################### 7 ###############################################################################
8 # 8 #
9 # android_setup.sh: Sets environment variables used by other Android scripts. 9 # android_setup.sh: Sets environment variables used by other Android scripts.
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 else 45 else
46 APP_ARGS=("${APP_ARGS[@]}" "${1}") 46 APP_ARGS=("${APP_ARGS[@]}" "${1}")
47 fi 47 fi
48 shift 48 shift
49 done 49 done
50 50
51 if [ "$USE_CLANG" == "true" ]; then 51 if [ "$USE_CLANG" == "true" ]; then
52 export GYP_DEFINES="skia_clang_build=1 $GYP_DEFINES" 52 export GYP_DEFINES="skia_clang_build=1 $GYP_DEFINES"
53 fi 53 fi
54 54
55 if [ "$SKIA_VULKAN" == "true" ]; then
56 export GYP_DEFINES="skia_vulkan=1 $GYP_DEFINES"
57 fi
58
59 function verbose { 55 function verbose {
60 if [[ -n $VERBOSE ]]; then 56 if [[ -n $VERBOSE ]]; then
61 echo $@ 57 echo $@
62 fi 58 fi
63 } 59 }
64 60
65 function exportVar { 61 function exportVar {
66 NAME=$1 62 NAME=$1
67 VALUE=$2 63 VALUE=$2
68 verbose export $NAME=\"$VALUE\" 64 verbose export $NAME=\"$VALUE\"
(...skipping 13 matching lines...) Expand all
82 echo "No ANDROID_SDK_ROOT set and can't auto detect it from location of and roid binary." 78 echo "No ANDROID_SDK_ROOT set and can't auto detect it from location of and roid binary."
83 exit 1 79 exit 1
84 fi 80 fi
85 fi 81 fi
86 82
87 if [ -z "$ANDROID_HOME" ]; then 83 if [ -z "$ANDROID_HOME" ]; then
88 echo "ANDROID_HOME not set so we are setting it to a default value of ANDROID_ SDK_ROOT" 84 echo "ANDROID_HOME not set so we are setting it to a default value of ANDROID_ SDK_ROOT"
89 exportVar ANDROID_HOME $ANDROID_SDK_ROOT 85 exportVar ANDROID_HOME $ANDROID_SDK_ROOT
90 fi 86 fi
91 87
88 if [ "$SKIA_VULKAN" == "true" ]; then
89 export GYP_DEFINES="skia_vulkan=1 $GYP_DEFINES"
90 # add cmake from the SDK to your path if it doesn't exist
91 if [ ! -d "${ANDROID_SDK_ROOT}/cmake" ]; then
92 echo "The Android SDK Tools version of CMake is required to build Vulkan. $ {ANDROID_SDK_ROOT}/cmake"
93 exit 1
94 else
95 export PATH=${ANDROID_SDK_ROOT}/cmake/bin:$PATH
96 fi
97 fi
98
92 # Helper function to configure the GYP defines to the appropriate values 99 # Helper function to configure the GYP defines to the appropriate values
93 # based on the target device. 100 # based on the target device.
94 setup_device() { 101 setup_device() {
95 DEFINES="OS=android" 102 DEFINES="OS=android"
96 DEFINES="${DEFINES} host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/' )" 103 DEFINES="${DEFINES} host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/' )"
97 DEFINES="${DEFINES} skia_os=android" 104 DEFINES="${DEFINES} skia_os=android"
98 DEFINES="${DEFINES} android_base=$(absPath ${SCRIPT_DIR}/..)" 105 DEFINES="${DEFINES} android_base=$(absPath ${SCRIPT_DIR}/..)"
99 if [[ "$GYP_DEFINES" != *skia_shared_lib=* ]]; then 106 if [[ "$GYP_DEFINES" != *skia_shared_lib=* ]]; then
100 DEFINES="${DEFINES} skia_shared_lib=1" 107 DEFINES="${DEFINES} skia_shared_lib=1"
101 fi 108 fi
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 $ADB $DEVICE_SERIAL shell mkdir -p "$(dirname "$ANDROID_DST")" 282 $ADB $DEVICE_SERIAL shell mkdir -p "$(dirname "$ANDROID_DST")"
276 $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST 283 $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST
277 fi 284 fi
278 fi 285 fi
279 286
280 # turn error checking back on 287 # turn error checking back on
281 set -e 288 set -e
282 } 289 }
283 290
284 setup_device "${DEVICE_ID}" 291 setup_device "${DEVICE_ID}"
OLDNEW
« no previous file with comments | « DEPS ('k') | tools/build_shaderc.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698