cocos2d-x避免手动修改android.mk文件来编译

前端之家收集整理的这篇文章主要介绍了cocos2d-x避免手动修改android.mk文件来编译前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

编辑android.mk文件,替换为如下内容

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
@H_301_54@ 22
23
24
25
26
27
28
29
30
LOCAL_PATH := $(call my-dir)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := cocos2dcpp_shared
LOCAL_MODULE_FILENAME := libcocos2dcpp
FILE_LIST := hellocpp/main.cpp
FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp)
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes
LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
LOCAL_WHOLE_STATIC_LIBRARIES += Box2d_static
LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static
include $(BUILD_SHARED_LIBRARY)
$(call import -module,cocos2dx)
Box2D)

上述脚本里

?
3
FILE_LIST := hellocpp/main.cpp
FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp)
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)


这三行就解决了每添加或者修改一个类文件名需要修改一次android.mk文件这个蛋疼的问题。

源地址:http://www.2cto.com/kf/201312/265632.html

猜你在找的Cocos2d-x相关文章