Skip to content

Commit

Permalink
Allow specifying APP_PLATFORM and APP_ABI on the command line
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jun 21, 2023
1 parent 214d5da commit 808d83d
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions build-scripts/androidbuildlibs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,27 @@ cd $srcdir

build=build
buildandroid=$build/android
platform=android-16
abi="arm64-v8a" # "armeabi-v7a arm64-v8a x86 x86_64"
obj=
lib=
ndk_args=

# Allow overriding the ABI from the environment
if [ "$APP_ABI" = "" ]; then
#APP_ABI="armeabi-v7a arm64-v8a x86 x86_64"
APP_ABI="arm64-v8a"
fi

# Allow overriding the platform from the environment
if [ "$APP_PLATFORM" = "" ]; then
APP_PLATFORM=android-16
fi

# Allow an external caller to specify locations.
for arg in $*; do
# Allow an external caller to specify locations and platform.
while [ $# -gt 0 ]; do
arg=$1
if [ "${arg:0:8}" == "NDK_OUT=" ]; then
obj=${arg#NDK_OUT=}
elif [ "${arg:0:13}" == "NDK_LIBS_OUT=" ]; then
lib=${arg#NDK_LIBS_OUT=}
elif [ "${arg:0:13}" == "APP_PLATFORM=" ]; then
platform=${arg#APP_PLATFORM=}
elif [ "${arg:0:8}" == "APP_ABI=" ]; then
abi=${arg#APP_ABI=}
else
ndk_args="$ndk_args $arg"
fi
shift
done

if [ -z $obj ]; then
Expand All @@ -75,7 +72,7 @@ ndk-build \
NDK_OUT=$obj \
NDK_LIBS_OUT=$lib \
APP_BUILD_SCRIPT=Android.mk \
APP_ABI="$APP_ABI" \
APP_PLATFORM="$APP_PLATFORM" \
APP_ABI="$abi" \
APP_PLATFORM="$platform" \
APP_MODULES="SDL3" \
$ndk_args

0 comments on commit 808d83d

Please sign in to comment.