SDL_net icon indicating copy to clipboard operation
SDL_net copied to clipboard

Missing Android.mk makefile?

Open superfury opened this issue 4 months ago • 8 comments

I noticed that the Android.mk file is missing for SDL3_net, required for compilation?

I've made one based on the old Android.mk and the current SDL3 Android.mk:

LOCAL_PATH := $(call my-dir)

###########################
#
# SDL_net shared library
#
###########################

include $(CLEAR_VARS)

LOCAL_MODULE := SDL3_net

LOCAL_C_INCLUDES := $(LOCAL_PATH)/include

LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include

LOCAL_SRC_FILES := \
	$(subst $(LOCAL_PATH)/,,) \
	$(wildcard $(LOCAL_PATH)/src/*.c) \

LOCAL_CFLAGS += \
	-Wall -Wextra \
	-Wmissing-prototypes \
	-Wunreachable-code-break \
	-Wunneeded-internal-declaration \
	-Wmissing-variable-declarations \
	-Wfloat-conversion \
	-Wshorten-64-to-32 \
	-Wunreachable-code-return \
	-Wshift-sign-overflow \
	-Wstrict-prototypes \
	-Wkeyword-macro \

# Warnings we haven't fixed (yet)
LOCAL_CFLAGS += -Wno-unused-parameter -Wno-sign-compare

LOCAL_CXXFLAGS += -std=gnu++11

LOCAL_LDLIBS :=

LOCAL_LDFLAGS := -Wl,--no-undefined -Wl,--no-undefined-version -Wl,--version-script=$(LOCAL_PATH)/src/SDL_net.sym

ifeq ($(NDK_DEBUG),1)
    cmd-strip :=
endif

LOCAL_SHARED_LIBRARIES := SDL3 android-ifaddrs

include $(BUILD_SHARED_LIBRARY)

###########################
#
# SDL_net static library
#
###########################

LOCAL_MODULE := SDL3_net_static

LOCAL_MODULE_FILENAME := libSDL3_net

LOCAL_LDLIBS :=

LOCAL_LDFLAGS :=

LOCAL_EXPORT_LDLIBS :=

LOCAL_STATIC_LIBRARIES := SDL3
LOCAL_SHARED_LIBRARIES := android-ifaddrs

include $(BUILD_STATIC_LIBRARY)

I managed to properly compile my app with it under Android Studio on Windows.

Although android-ifaddrs support is required to compile SDL3_net (My created Android port of it: https://github.com/superfury/android-ifaddrs).

superfury avatar Oct 21 '24 23:10 superfury