cocos2d-x android.mk文件中添加源文件,不需要每个cpp都去手动去包含一次


# 遍历目录及子目录的函数 

define walk 
$(wildcard $(1)) $(foreach e, $(wildcard $(1)/*), $(call walk, $(e))) 
endef 
# 遍历Classes目录 
ALLFILES = $(call walk, $(LOCAL_PATH)/../../Classes) 
FILE_LIST := hellocpp/main.cpp 
# 从所有文件中提取出所有.cpp文件 
FILE_LIST += $(filter %.cpp, $(ALLFILES)) 
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%) 
FILE_INCLUDES := $(shell find $(LOCAL_PATH)/../../Classes -type d) 
LOCAL_C_INCLUDES := $(FILE_INCLUDES)

你可能感兴趣的:(cocos2d-x android.mk文件中添加源文件,不需要每个cpp都去手动去包含一次)