I use the Android NDK to create my cocos2dx project, Android.mk has a definition for LOCAL_SRC_FILES, which lists each of the cpp files. Whenever I add a new source file, I also need to add it there ... it looks like this:
LOCAL_SRC_FILES := hellocpp/main.cpp \ hellocpp/myclass.cpp \ hellocpp/mynextclass.cpp \ ../../Classes/Screens/LaunchScreen.cpp \
the header file, however, can indicate the entire included directory, as follows:
LOCAL_C_INCLUDES := $(LOCAL_PATH)/hellocpp LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../Classes/Screens
I tried various ways to include the entire directory instead of a single file for LOCAL_SRC_FILES , so I do not need to change the version of the Android.mk script every time I add a new file, however, all my attempts failed.
I tried this:
#SRC_PATH_HELLOCPP := $(wildcard hellocpp/*.cpp)
and:
#LOCAL_SRC_FILES += hellocpp/*.cpp
both do not work ...
I have another project that works well with the first option, although I really do not understand why it does not work in the cocos2dx project ... does anyone know why or know the solution? Or maybe I should just leave it as it is and take the trouble, as everyone does it, but itβs really troublesome, I hope someone can help, so that we can all be more productive.
Thanks!
android android-ndk cocos2d-x cocos2d-iphone
Zennichimaro
source share