It looks like you're new here. If you want to get involved, click one of these buttons!
By the way the templates\advance_game\Makefile.Android did not work for me in the latest dev branch.
# Compile native_app_glue code as static library: obj/libnative_app_glue.a
compile_native_app_glue:
$(CC) -c $(RAYLIB_PATH)/src/external/android/native_app_glue/android_native_app_glue.c -o $(PROJECT_BUILD_PATH)/obj/native_app_glue.o $(CFLAGS)
$(AR) rcs $(PROJECT_BUILD_PATH)/obj/libnative_app_glue.a $(PROJECT_BUILD_PATH)/obj/native_app_glue.o
# Compile project code into a shared library: lib/lib$(PROJECT_LIBRARY_NAME).so
compile_project_code: $(OBJS)
$(GP) -std=gnu++14 -o $(PROJECT_BUILD_PATH)/lib/armeabi-v7a/lib$(PROJECT_LIBRARY_NAME).so $(OBJS) -shared $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS)
# Compile all .c files required into object (.o) files
# NOTE: Those files will be linked into a shared library
$(PROJECT_BUILD_PATH)/obj/%.o:%.c
$(GP) -std=gnu++14 -c $^ -o $@ $(INCLUDE_PATHS) $(CFLAGS) --sysroot=$(ANDROID_TOOLCHAIN)/sysroot
Comments
I need to check it more carefully but g++ support on Android NDK is being deprecated (I think it has some issues), they are moving to clang compiler.
Also, if using github raylib develop branch, LOT of things have changed and it could be not stable...
I'll try to review it this week and let you know.
python make_standalone_toolchain.py --arch arm --api 16 --stl=libc++ --install-dir=ndk_toolchain_arm_api16_libc++
I got it working with gnustl :
python make_standalone_toolchain.py --arch arm --api 16 --stl=gnustl --install-dir=ndk_toolchain_arm_api16_gnustl
I read gnustl is default. I should have left it out from the start! Working setting below:
..
CXXFLAGS = -std=c++14 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16
CXXFLAGS += -ffunction-sections -funwind-tables -fstack-protector-strong -fPIC
CXXFLAGS += -Wall -Wa,--noexecstack -Wformat -Werror=format-security -no-canonical-prefixes
CXXFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=16
..
# Generate target objects list from PROJECT_SOURCE_FILES
OBJS = $(patsubst %.cpp, $(PROJECT_BUILD_PATH)/obj/%.o, $(PROJECT_SOURCE_FILES))
..
compile_native_app_glue:
$(CC) -c $(RAYLIB_PATH)/src/external/android/native_app_glue/android_native_app_glue.c -o $(PROJECT_BUILD_PATH)/obj/native_app_glue.o $(CFLAGS)
$(AR) rcs $(PROJECT_BUILD_PATH)/obj/libnative_app_glue.a $(PROJECT_BUILD_PATH)/obj/native_app_glue.o
compile_project_code: $(OBJS)
$(GP) -o $(PROJECT_BUILD_PATH)/lib/armeabi-v7a/lib$(PROJECT_LIBRARY_NAME).so $(OBJS) -shared $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS)
$(PROJECT_BUILD_PATH)/obj/%.o:%.cpp
$(GP) -c $^ -o $@ $(INCLUDE_PATHS) $(CXXFLAGS) --sysroot=$(ANDROID_TOOLCHAIN)/sysroot
Glad to read you manage to get it working! That's amazing!
Please, keep me updated with your progress!
Ray