Searching on several projects, I found this line on their android.mk $(call all-proto-files-under, $(src_proto))
, and I tried to use this like that:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := my_test
src_proto := $(LOCAL_PATH)/proto
LOCAL_CPP_EXTENSION := .cxx .cpp .cc
LOCAL_CPPFLAGS += -std=c++11
LOCAL_SRC_FILES := main.cc \
$(call all-proto-files-under, $(src_proto))
# print the source files
$(warning $(LOCAL_SRC_FILES))
# print only main.cc
$(warning $(LOCAL_SRC_FILES))
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include \
$(LOCAL_PATH)/proto
# for logging
LOCAL_LDLIBS += -llog
# for native asset manager
LOCAL_LDLIBS += -landroid
include $(BUILD_SHARED_LIBRARY)
But it doesn't work, the warning prints nothing, and the second warning prints only main.cc, the line $(call all-proto-files-under, $(src_proto))
does nothing. I would like to know how can I use protobuf with android ndk.