[android] back to shared library link

This commit is contained in:
Walzer 2011-06-25 11:21:16 +08:00
parent 70b4d701d3
commit 00568c229a
11 changed files with 58 additions and 39 deletions

View File

@ -43,4 +43,4 @@ Dynamics/b2WorldCallbacks.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
include $(BUILD_STATIC_LIBRARY)
include $(BUILD_SHARED_LIBRARY)

View File

@ -5,7 +5,9 @@ LOCAL_MODULE := cocosdenshion
LOCAL_SRC_FILES := SimpleAudioEngine.cpp \
jni/SimpleAudioEngineJni.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include \
$(LOCAL_PATH)/../../cocos2dx
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include
LOCAL_LDLIBS := -llog
include $(BUILD_STATIC_LIBRARY)
include $(BUILD_SHARED_LIBRARY)

View File

@ -1,5 +1,4 @@
#include "SimpleAudioEngineJni.h"
#include "platform/android/Cocos2dJni.h"
#include <android/log.h>
#define LOG_TAG "libSimpleAudioEngine"
@ -8,9 +7,17 @@
extern "C"
{
static JavaVM *gJavaVM = 0;
static jclass classOfCocos2dxActivity = 0;
JNIEnv *env = 0;
jint JNI_OnLoad(JavaVM *vm, void *reserved)
{
gJavaVM = vm;
return JNI_VERSION_1_4;
}
static jmethodID getMethodID(const char *methodName, const char *paramCode)
{
jmethodID ret = 0;

View File

@ -1,4 +1,4 @@
# it is needed for ndk-r5
APP_STL := stlport_static
APP_MODULES := helloworld
APP_MODULES := cocos2d cocosdenshion helloworld

View File

@ -15,22 +15,15 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../cocos2dx \
# it is used for ndk-r4
# if you build with nkd-r4, uncomment it
# LOCAL_LDLIBS := -llog -lGLESv1_CM -lz \
# -L$(LOCAL_PATH)/../../../../cocos2dx/platform/third_party/android/libraries -lcurl \
# -lpng \
# -lxml2 \
# -ljpeg
# LOCAL_LDLIBS := -L$(LOCAL_PATH)/../../libs/armeabi -lcocos2d -llog -lcocosdenshion \
# -L$(LOCAL_PATH)/../../../../cocos2dx/platform/third_party/android/libraries -lcurl
# it is used for ndk-r5
# if you build with ndk-r4, comment it
# because the new Windows toolchain doesn't support Cygwin's drive
# mapping (i.e /cygdrive/c/ instead of C:/)
LOCAL_LDLIBS := -llog -lGLESv1_CM -lz \
-L$(call host-path, $(LOCAL_PATH)/../../../../cocos2dx/platform/third_party/android/libraries) -lcurl \
-lpng \
-lxml2 \
-ljpeg
LOCAL_STATIC_LIBRARIES := libcocos2d libcocosdenshion
LOCAL_LDLIBS := -L$(call host-path, $(LOCAL_PATH)/../../libs/armeabi) \
-lcocos2d -llog -lcocosdenshion \
-L$(call host-path, $(LOCAL_PATH)/../../../../cocos2dx/platform/third_party/android/libraries) -lcurl
include $(BUILD_SHARED_LIBRARY)

View File

@ -43,6 +43,8 @@ public class ApplicationDemo extends Cocos2dxActivity{
}
static {
System.loadLibrary("cocos2d");
System.loadLibrary("cocosdenshion");
System.loadLibrary("helloworld");
}
}

View File

@ -35,4 +35,4 @@ src/cpVect.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include/chipmunk
LOCAL_CFLAGS := -std=c99
include $(BUILD_STATIC_LIBRARY)
include $(BUILD_SHARED_LIBRARY)

View File

@ -108,8 +108,25 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/ \
$(LOCAL_PATH)/platform/third_party/android/libpng \
$(LOCAL_PATH)/platform/third_party/android/libxml2 \
$(LOCAL_PATH)/platform/third_party/android/libjpeg
# it is used for ndk-r4
# if you build with nkd-r4, uncomment it
# LOCAL_LDLIBS := -L$(LOCAL_PATH)/platform/third_party/android/libraries \
# -lGLESv1_CM -llog -lz \
# -lpng \
# -lxml2 \
# -ljpeg
# it is used for ndk-r5
# if you build with ndk-r4, comment it
# because the new Windows toolchain doesn't support Cygwin's drive
# mapping (i.e /cygdrive/c/ instead of C:/)
LOCAL_LDLIBS := -L$(call host-path, $(LOCAL_PATH)/platform/third_party/android/libraries) \
-lGLESv1_CM -llog -lz \
-lpng \
-lxml2 \
-ljpeg
# define the macro to compile through support/zip_support/ioapi.c
LOCAL_CFLAGS := -DUSE_FILE32API
LOCAL_CFLAGS := -DUSE_FILE32API
include $(BUILD_STATIC_LIBRARY)
include $(BUILD_SHARED_LIBRARY)

View File

@ -2,4 +2,4 @@
APP_STL := stlport_static
APP_ABI := armeabi armeabi-v7a
APP_MODULES := tests
APP_MODULES := cocos2d cocosdenshion chipmunk box2d tests

View File

@ -85,28 +85,22 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../cocos2dx \
# it is used for ndk-r4
# if you build with nkd-r4, uncomment it
# LOCAL_LDLIBS := -lGLESv1_CM \
# -llog \
# -lz
# -L$(LOCAL_PATH)/../../../../cocos2dx/platform/third_party/android/libraries -lcurl \
# -lpng \
# -lxml2 \
# -ljpeg
# LOCAL_LDLIBS := -L$(LOCAL_PATH)/../../libs/armeabi \
# -lGLESv1_CM \
# -lcocos2d -lcocosdenshion -llog \
# -lbox2d -lchipmunk \
# -L$(LOCAL_PATH)/../../../../cocos2dx/platform/third_party/android/libraries -lcurl
# it is used for ndk-r5
# if you build with ndk-r4, comment it
# because the new Windows toolchain doesn't support Cygwin's drive
# mapping (i.e /cygdrive/c/ instead of C:/)
LOCAL_LDLIBS := -lGLESv1_CM \
-llog \
-lz \
-L$(call host-path, $(LOCAL_PATH)/../../../../cocos2dx/platform/third_party/android/libraries) -lcurl \
-lpng \
-lxml2 \
-ljpeg
LOCAL_STATIC_LIBRARIES := libcocos2d libcocosdenshion libbox2d libchipmunk
LOCAL_LDLIBS := -L$(call host-path, $(LOCAL_PATH)/../../libs/armeabi) \
-lGLESv1_CM \
-lcocos2d -llog -lcocosdenshion \
-lbox2d -lchipmunk \
-L$(call host-path, $(LOCAL_PATH)/../../../../cocos2dx/platform/third_party/android/libraries) -lcurl
include $(BUILD_SHARED_LIBRARY)

View File

@ -46,6 +46,10 @@ public class TestsDemo extends Cocos2dxActivity{
}
static {
System.loadLibrary("cocosdenshion");
System.loadLibrary("chipmunk");
System.loadLibrary("box2d");
System.loadLibrary("cocos2d");
System.loadLibrary("tests");
}
}