0

我正在尝试将所有 目录和所有文件都包含.cpp在子目录中。但我不能这样做,请检查我的打击文件。Classes,EasyLib and EasyLibUse.cppandroid.mk

我这样做是为了包含我的游戏.cpp文件。cocos2dxandroid

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := game_shared

LOCAL_MODULE_FILENAME := libgame

FILE_LIST := $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp)
FILE_LIST += $(wildcard $(LOCAL_PATH)/../../EasyLib/**/*.cpp)
FILE_LIST += $(wildcard $(LOCAL_PATH)/../../EasyLibUse/**/*.cpp)

LOCAL_SRC_FILES := hellocpp/main.cpp \
                   $(FILE_LIST:$(LOCAL_PATH)/%=%)

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes                   
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../Lib  
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../LibUse  

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)

编辑:

FILE_LIST += $(wildcard $(LOCAL_PATH)/../../EasyLib/**/*.cpp)

FILE_LIST += $(wildcard $(LOCAL_PATH)/../../EasyLibUse/**/*.cpp)

这两个无法在子目录中构建 .cpp 文件。

问候, Aqif

4

1 回答 1

1

这是我的 Android.mk,我想这就是你要找的:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := game_shared

LOCAL_MODULE_FILENAME := libgame

cppfiles := $(shell find $(LOCAL_PATH) -name "*.cpp" -printf "%P \n")

LOCAL_SRC_FILES := $(cppfiles)


folders := $(shell find $(LOCAL_PATH) -type d -printf "%P \n")

LOCAL_C_INCLUDES := $(folders)     

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) 
于 2012-12-11T17:17:16.533 回答