cocos2d-x项目中如何避免增加一个cpp就必须在工程android.mk文件去添加引用

时间:2021-08-01 06:52:26

LOCAL_SRC_FILES := hellocpp/main.cpp \

                       ../../Classes/AppDelegate.cpp \                   

           ../../Classes/HelloWorldScene.cpp

只要把上面这些替换成下面的:

SRC_FILES := hellocpp/main.cpp

SRC_FILES += $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp)

SRC_FILES += $(wildcard $(LOCAL_PATH)/../../Classes/*/*.cpp)

SRC_FILES += $(wildcard $(LOCAL_PATH)/../../Classes/*/*/*.cpp)

SRC_FILES += $(wildcard $(LOCAL_PATH)/../../Classes/*/*/*/*.cpp)

LOCAL_SRC_FILES := $(SRC_FILES:$(LOCAL_PATH)/%=%)

 

 

转载自 http://www.cnblogs.com/Colored-Mr/p/4721073.html