xref: /aosp_15_r20/external/executorch/examples/demo-apps/android/LlamaDemo/setup-with-qnn.sh (revision 523fa7a60841cd1ecfb9cc4201f1ca8b03ed023a)
1#!/usr/bin/env bash
2# Copyright (c) Meta Platforms, Inc. and affiliates.
3# All rights reserved.
4#
5# This source code is licensed under the BSD-style license found in the
6# LICENSE file in the root directory of this source tree.
7
8set -eu
9
10if [ -z "$QNN_SDK_ROOT" ]; then
11  echo "You must specify QNN_SDK_ROOT"
12  exit 1
13fi
14
15BASEDIR=$(dirname "$0")
16source "$BASEDIR"/../../../../build/build_android_llm_demo.sh
17
18BUILD_AAR_DIR="$(mktemp -d)"
19export BUILD_AAR_DIR
20
21build_jar
22build_android_native_library "arm64-v8a"
23build_aar
24mkdir -p "$BASEDIR"/app/libs
25cp "$BUILD_AAR_DIR/executorch.aar" "$BASEDIR"/app/libs/executorch.aar
26