Corrected issue with compiler param

Added android_native_app_glue module to raylib compilation instead of
compiling it as static lib at apk generation.
This commit is contained in:
Ray 2018-05-27 19:06:14 +02:00
parent f89afaa335
commit 1f0cc57ec7
4 changed files with 8 additions and 5 deletions

View file

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

View file

@ -77,7 +77,7 @@ AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar
# Compiler flags for arquitecture # Compiler flags for arquitecture
#CFLAGS = -std=c99 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 --> Old 32bit #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 # Compilation functions attributes options
CFLAGS += -ffunction-sections -funwind-tables -fstack-protector-strong -fPIC CFLAGS += -ffunction-sections -funwind-tables -fstack-protector-strong -fPIC
# Compiler options for the linker # 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 # Define any libraries to link into executable
# if you want to link libraries (libname.so or libname.a), use the -lname # 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 # Generate target objects list from PROJECT_SOURCE_FILES
OBJS = $(patsubst %.c, $(PROJECT_BUILD_PATH)/obj/%.o, $(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_android_manifest \
generate_apk_keystore \ generate_apk_keystore \
config_project_package \ config_project_package \
compile_native_app_glue \
compile_project_code \ compile_project_code \
compile_project_class \ compile_project_class \
compile_project_class_dex \ compile_project_class_dex \