From c11b437a151e510a301ab83fa02cec54ad5b2f17 Mon Sep 17 00:00:00 2001 From: ardocrat Date: Wed, 17 May 2023 21:06:02 +0300 Subject: [PATCH] build: update build script --- build_and_run.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/build_and_run.sh b/build_and_run.sh index 4c46d4a..67a7838 100755 --- a/build_and_run.sh +++ b/build_and_run.sh @@ -1,5 +1,17 @@ -mode="release" -export CPPFLAGS="-DMDB_USE_ROBUST=0" && export CFLAGS="-DMDB_USE_ROBUST=0" && cargo ndk -t arm64-v8a build --${mode} +#!/bin/bash + +case $1 in + debug|release) + ;; + *) + echo "Usage: build_and_run.sh [type] where is type is 'debug' or 'release'" >&2 + exit 1 +esac + +type=$1 +[[ ${type} == "release" ]] && release_param+=(--release) +export CPPFLAGS="-DMDB_USE_ROBUST=0" && export CFLAGS="-DMDB_USE_ROBUST=0" && cargo ndk -t arm64-v8a build ${release_param[@]} + if [ $? -eq 0 ] then yes | cp -f target/aarch64-linux-android/${mode}/libgrim_android.so app/src/main/jniLibs/arm64-v8a