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.
     1 LOCAL_PATH := $(call my-dir)
     2 
     3 include $(CLEAR_VARS)
     4 
     5 LOCAL_MODULE := main
     6 
     7 SDL_PATH := ../SDL
     8 
     9 LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include
    10 
    11 # Add your application source files here...
    12 LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.c \
    13 	YourSourceHere.c
    14 
    15 LOCAL_SHARED_LIBRARIES := SDL2
    16 
    17 LOCAL_LDLIBS := -lGLESv1_CM -llog
    18 
    19 include $(BUILD_SHARED_LIBRARY)