android-project/jni/src/Android.mk
author Eric Wing <ewing . public |-at-| gmail . com>
Mon, 22 Jul 2013 02:51:45 -0700
changeset 7501 b27825bb5879
parent 6288 1204ff03a0c1
child 8014 0a4b6dec7de5
permissions -rw-r--r--
Android: Removed all unnecessary dependencies on C++.

C++ is a bit of a minefield on Android. Much functionality still doesn't work, and Android can't decide on which C++ standard library to use, so it provides 3 different ones, all of which are incompatible with each other. (It looks like clang is coming too which will add a new compiler and a 4th standard library.)

As middleware, SDL might be distributed as a binary and intermixed with other projects already using C++. If C++ is intermixed in a bad way, bad things will happen. Removing dependencies on C++ will avoid this problem and downstream users won't have to worry/care.
slouken@4965
     1
LOCAL_PATH := $(call my-dir)
slouken@4965
     2
slouken@4965
     3
include $(CLEAR_VARS)
slouken@4965
     4
slouken@4965
     5
LOCAL_MODULE := main
slouken@4965
     6
slouken@4965
     7
SDL_PATH := ../SDL
slouken@4965
     8
slouken@4965
     9
LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include
slouken@4965
    10
slouken@4965
    11
# Add your application source files here...
ewing@7501
    12
LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.c \
slouken@4965
    13
	YourSourceHere.c
slouken@4965
    14
slouken@6288
    15
LOCAL_SHARED_LIBRARIES := SDL2
slouken@4965
    16
slouken@4965
    17
LOCAL_LDLIBS := -lGLESv1_CM -llog
slouken@4965
    18
slouken@4965
    19
include $(BUILD_SHARED_LIBRARY)