Fix ANDROID_ASSETS option;

This commit is contained in:
bjorn 2020-06-29 17:51:15 -06:00
parent d8f7325bc7
commit 0a27a0b17b
3 changed files with 10 additions and 1 deletions

View File

@ -648,6 +648,10 @@ elseif(ANDROID)
set(ANDROID_LIBS_DST ${ANDROID_LIBS_DST} "lib/${ANDROID_ABI}/libvrapi.so")
endif()
if(ANDROID_ASSETS)
set(ANDROID_ASSETS_FLAG -A ${ANDROID_ASSETS})
endif()
# Compile java file to class file
add_custom_command(
OUTPUT ${ACTIVITY_CLASS}
@ -680,6 +684,7 @@ elseif(ANDROID)
-M ${ANDROID_MANIFEST}
-I ${ANDROID_JAR}
-F lovr.unaligned.apk
${ANDROID_ASSETS_FLAG}
COMMAND
${ANDROID_BUILD_TOOLS}/aapt
add -f

View File

@ -83,7 +83,7 @@ ifeq ($(PLATFORM),android)
# Create an apk from the Android manifest. The zip command is used afterwards to add raw files
# because it is way faster than calling aapt again and apks are just zips (TODO windows).
: @(ANDROID_MANIFEST) | $(LIB)/*.so classes.dex |> ^ AAPT %b^ aapt package -F %o -M %f -I $(ANDROID_JAR) -A @(ANDROID_ASSETS) && zip -qu0 %o $(LIB)/*.so classes.dex |> tmp/lovr.unaligned.apk
: @(ANDROID_MANIFEST) | $(LIB)/*.so classes.dex |> ^ AAPT %b^ aapt package -F %o -M %f -I $(ANDROID_JAR) $(ANDROID_ASSETS) && zip -qu0 %o $(LIB)/*.so classes.dex |> tmp/lovr.unaligned.apk
# Even though we have an apk, it isn't actually valid yet. It has to be aligned using the special
# zipalign tool, and then signed using apksigner.

View File

@ -188,6 +188,10 @@ ifeq ($(PLATFORM),android)
PREFIX = $(LIB)/lib
SUFFIX = .so
ifneq (@(ANDROID_ASSETS),)
ANDROID_ASSETS = -A @(ANDROID_ASSETS)
endif
# Macros
!dx = |> ^ DX %b^ dx --dex --output=%o %f |>
!zipalign = |> ^ ZIPALIGN %f^ $(TOOLS)/zipalign -f 4 %f %o |>