Pass APP_ABI to ndk-build instead of creating temporary Application.mk

It's simpler and stores objects inside obj/ in-tree,
preventing unnecessary rebuilds.
This commit is contained in:
link2xt 2022-07-06 00:00:00 +00:00
parent 74b6da430b
commit 2a5efba763

View file

@ -138,22 +138,15 @@ rm -fr "$TMPLIB"
echo -- ndk-build -- echo -- ndk-build --
cd .. cd ../..
# Set the right arch in Application.mk:
oldDotMk="$(cat Application.mk)"
TMP=$(mktemp)
if test $1; then if test $1; then
sed "s/APP_ABI.*/APP_ABI := $1/g" Application.mk >"$TMP" ndk-build APP_ABI="$1"
else else
# We are compiling for all architectures: # We are compiling for all architectures defined in Application.mk
sed "s/APP_ABI.*/APP_ABI := armeabi-v7a arm64-v8a x86 x86_64/g" Application.mk >"$TMP" ndk-build
fi fi
cd ..
ndk-build NDK_APPLICATION_MK=$TMP
rm "$TMP"
if test $1; then if test $1; then
echo "NDK_ARCH=$1" >ndkArch echo "NDK_ARCH=$1" >ndkArch
else else