./jni/Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := game_shared
LOCAL_MODULE_FILENAME := libgame
LOCAL_SRC_FILES := hellocpp/main.cpp
define all-cpp-files-under
$(patsubst ./%,%, \
$(shell cd $(LOCAL_PATH) ; \
find ../../Classes -name "*.cpp" -and -not -name ".*") \
)
endef
define all-subdir-cpp-files
$(call all-cpp-files-under,.)
endef
LOCAL_SRC_FILES += $(call all-subdir-cpp-files)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static cocos_extension_static
include $(BUILD_SHARED_LIBRARY)
$(call import-module,CocosDenshion/android) \
$(call import-module,cocos2dx) \
$(call import-module,extensions)
主要是修改 LOCAL_SRC_FILES 部分
原内容为
LOCAL_SRC_FILES := hellocpp/main.cpp \
../../Classes/AppDelegate.cpp \
../../Classes/HelloWorldScene.cpp
修改后
LOCAL_SRC_FILES := hellocpp/main.cpp
define all-cpp-files-under
$(patsubst ./%,%, \
$(shell cd $(LOCAL_PATH) ; \
find ../../Classes -name "*.cpp" -and -not -name ".*") \
)
endef
define all-subdir-cpp-files
$(call all-cpp-files-under,.)
endef
LOCAL_SRC_FILES += $(call all-subdir-cpp-files)