Exporting header files
When dealing with third-party native libraries, it is very common to be able to access headers. For example, in a file using our shared library, we will find includes requiring access to our header files:
#include <file.h>
In this case, we will need to provide the headers to all the modules. Probably the easiest way to achieve this is to use exports in the Android.mk
file. Look at the following code example, taken from an Android.mk
file requiring some headers. As long as the file.h
file, from the preceding line is within the include
folder, the module will work properly:
include $(CLEAR_VARS) LOCAL_MODULE := library-user LOCAL_SRC_FILES := library-user.c LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include include $(PREBUILT_SHARED_LIBRARY)