我试图在.cpp
个目录中包含所有Classes,EasyLib and EasyLibUse
,并在子目录中包含所有.cpp
个文件。但我无法这样做,请检查我的打击android.mk
文件。
我这样做是为.cpp
添加cocos2dx
android
个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)
修改
{{1}}
这两个无法在子目录中构建.cpp文件。
的问候, Aqif
答案 0 :(得分: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)