瀏覽代碼

Corrected issue with compiler param

Added android_native_app_glue module to raylib compilation instead of
compiling it as static lib at apk generation.
Ray 7 年之前
父節點
當前提交
1f0cc57ec7
共有 4 個文件被更改,包括 8 次插入5 次删除
  1. 二進制
      release/libs/android/arm64-v8a/libraylib.a
  2. 二進制
      release/libs/android/arm64-v8a/libraylib.so
  3. 6 2
      src/Makefile
  4. 2 3
      templates/standard_game/Makefile.Android

二進制
release/libs/android/arm64-v8a/libraylib.a


二進制
release/libs/android/arm64-v8a/libraylib.so


+ 6 - 2
src/Makefile

@@ -309,14 +309,14 @@ endif
 ifeq ($(PLATFORM),PLATFORM_ANDROID)
     # Compiler flags for arquitecture (only ARM, not ARM64)
     #CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16
-    CFLAGS += -target aarch64 -mfix-cortex-a53-835769 -mgeneral-regs-only
+    CFLAGS += -target aarch64 -mfix-cortex-a53-835769
     # Compilation functions attributes options
     CFLAGS += -ffunction-sections -funwind-tables -fstack-protector-strong -fPIE -fPIC
     # Compiler options for the linker
     # -Werror=format-security
     CFLAGS += -Wa,--noexecstack -Wformat -no-canonical-prefixes
     # Preprocessor macro definitions
-    CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=21
+    CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=21 -DMAL_NO_OSS
 endif
 
 # Define required compilation flags for raylib SHARED lib
@@ -416,6 +416,10 @@ ifeq ($(INCLUDE_AUDIO_MODULE),TRUE)
     endif
 endif
 
+ifeq ($(PLATFORM),PLATFORM_ANDROID)
+    OBJS += external/android/native_app_glue/android_native_app_glue.o
+endif
+
 # Default target entry
 all: raylib
 

+ 2 - 3
templates/standard_game/Makefile.Android

@@ -77,7 +77,7 @@ AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar
 
 # Compiler flags for arquitecture
 #CFLAGS = -std=c99 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 --> Old 32bit
-CFLAGS = -std=c99 -target aarch64
+CFLAGS = -std=c99 -target aarch64 -mfix-cortex-a53-835769
 # Compilation functions attributes options
 CFLAGS += -ffunction-sections -funwind-tables -fstack-protector-strong -fPIC
 # Compiler options for the linker
@@ -98,7 +98,7 @@ LDFLAGS += -L. -L$(PROJECT_BUILD_PATH)/obj -L$(PROJECT_BUILD_PATH)/lib/arm64-v8a
 
 # Define any libraries to link into executable
 # if you want to link libraries (libname.so or libname.a), use the -lname
-LDLIBS = -static -lraylib -lnative_app_glue -llog -landroid -lEGL -lGLESv2 -lOpenSLES -lm -ldl -lc
+LDLIBS = -lm -lc -lraylib -llog -landroid -lEGL -lGLESv2 -lOpenSLES -ldl
 
 # Generate target objects list from PROJECT_SOURCE_FILES
 OBJS = $(patsubst %.c, $(PROJECT_BUILD_PATH)/obj/%.o, $(PROJECT_SOURCE_FILES))
@@ -112,7 +112,6 @@ all: create_temp_project_dirs \
      generate_android_manifest \
      generate_apk_keystore \
      config_project_package \
-     compile_native_app_glue \
      compile_project_code \
      compile_project_class \
      compile_project_class_dex \