Support shared library building on Android
This commit is contained in:
parent
ca69068814
commit
8e0cd51afb
3 changed files with 4 additions and 1 deletions
Binary file not shown.
BIN
release/libs/android/arm64-v8a/libraylib.so
Normal file
BIN
release/libs/android/arm64-v8a/libraylib.so
Normal file
Binary file not shown.
|
@ -383,11 +383,13 @@ endif
|
||||||
# Define linker options
|
# Define linker options
|
||||||
ifeq ($(PLATFORM),PLATFORM_ANDROID)
|
ifeq ($(PLATFORM),PLATFORM_ANDROID)
|
||||||
LDFLAGS = -Wl,-soname,libraylib.$(API_VERSION).so -Wl,--exclude-libs,libatomic.a
|
LDFLAGS = -Wl,-soname,libraylib.$(API_VERSION).so -Wl,--exclude-libs,libatomic.a
|
||||||
LDFLAGS += -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings
|
LDFLAGS += -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings
|
||||||
# Force linking of library module to define symbol
|
# Force linking of library module to define symbol
|
||||||
LDFLAGS += -u ANativeActivity_onCreate
|
LDFLAGS += -u ANativeActivity_onCreate
|
||||||
# Library paths containing required libs
|
# Library paths containing required libs
|
||||||
LDFLAGS += -L. -Lsrc -L$(RAYLIB_RELEASE_PATH)
|
LDFLAGS += -L. -Lsrc -L$(RAYLIB_RELEASE_PATH)
|
||||||
|
# Avoid unresolved symbol pointing to external main()
|
||||||
|
LDFLAGS += -Wl,-undefined,dynamic_lookup
|
||||||
|
|
||||||
LDLIBS = -llog -landroid -lEGL -lGLESv2 -lOpenSLES -latomic -lc -lm
|
LDLIBS = -llog -landroid -lEGL -lGLESv2 -lOpenSLES -latomic -lc -lm
|
||||||
endif
|
endif
|
||||||
|
@ -473,6 +475,7 @@ else
|
||||||
ifeq ($(PLATFORM),PLATFORM_ANDROID)
|
ifeq ($(PLATFORM),PLATFORM_ANDROID)
|
||||||
$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so $(OBJS) $(LDFLAGS) $(LDLIBS)
|
$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so $(OBJS) $(LDFLAGS) $(LDLIBS)
|
||||||
@echo "raylib shared library generated (libraylib.$(RAYLIB_VERSION).so)!"
|
@echo "raylib shared library generated (libraylib.$(RAYLIB_VERSION).so)!"
|
||||||
|
# WARNING: symbolic links creation on Windows should be done using mklink command, no ln available
|
||||||
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.$(RAYLIB_API_VERSION).so
|
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.$(RAYLIB_API_VERSION).so
|
||||||
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.so
|
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.so
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue