Unable to export includes in shared library

781 views
Skip to first unread message

Kartik Aiyer

unread,
May 31, 2018, 5:54:32 PM5/31/18
to android-platform

Hello,

I’m having some trouble getting exported include paths into the intermediate that is generated for a shared library.

I have a library called coreGL whose Android.mk file looks like This

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../\
              $(LOCAL_PATH)/../../Vendor/fmt/include\
              $(LOCAL_PATH)/../../Vendor/Eigen

# I have tried this with LOCAL_EXPORT_C_INCLUDE_DIRS as well
LOCAL_EXPORT_C_INCLUDES: := $(LOCAL_PATH)/../../

FILE_LIST := $(wildcard $(LOCAL_PATH)/*.cpp )
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
LOCAL_SRC_FILES += $(call all-cpp-files-under, Android )

LOCAL_LDLIBS += -lEGL
LOCAL_LDLIBS += -lGLESv3
LOCAL_LDLIBS += -llog

LOCAL_SHARED_LIBRARIES := com.rylo.coreBase\
              com.rylo.fmt\
              com.rylo.coreLog

ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION),5 6 7),)
LOCAL_SHARED_LIBRARIES += libnativewindow
endif

LOCAL_MODULE := com.rylo.coreGL

include $(BUILD_SHARED_LIBRARY)

I’m using the library in another module whose Android.mk looks like This

LOCAL_PATH := $(call my-dir)
CAMX_CHICDK_PATH := $(LOCAL_PATH)/../../qcom/proprietary/chi-cdk/
include $(CLEAR_VARS)

# Module supports function call tracing via ENABLE_FUNCTION_CALL_TRACE
# Required before including common.mk
SUPPORT_FUNCTION_CALL_TRACE := 1

# Get definitions common to the CAMX project here
include $(CAMX_CHICDK_PATH)/vendor/common.mk

LOCAL_INC_FILES :=              \
    rylostitchnode.h

LOCAL_SRC_FILES :=              \
    rylostitchnode.cpp

LOCAL_C_LIBS := $(CAMX_C_LIBS)

LOCAL_C_INCLUDES :=               \
    $(CAMX_C_INCLUDES)            \
    $(CAMX_CDK_PATH)/node/        \
    system/media/camera/include

# Compiler flags
LOCAL_CFLAGS := $(CAMX_CFLAGS)
LOCAL_CPPFLAGS := $(CAMX_CPPFLAGS)

LOCAL_SHARED_LIBRARIES :=           \
    libcamera_metadata              \
    libcom.qti.chinodeutils\
    com.rylo.coreGL

LOCAL_LDLIBS += -lEGL

LOCAL_LDLIBS += -lGLESv2

LOCAL_MODULE := com.qti.node.stich

LOCAL_MODULE_PATH := $(CAMX_LIB_OUTPUT_PATH)

include $(BUILD_SHARED_LIBRARY)

The include paths exported are not added to the -I flags when compiling the module.
I cleaned the coreGL lib, rebuilt it and went to out/target/…/SHARED_LIBRARIES/com.rylo.coreGL_intermediates/export_includes however it is empty

From what I understand, the LOCAL_EXPORT_C_INCLUDES should get added to the libraries export_includes. Can anyone tell what I’m doing wrong which result
the include paths not being exported ?

Thanks
Kartik

Colin Cross

unread,
May 31, 2018, 6:12:35 PM5/31/18
to android-...@googlegroups.com
You have an extra colon after LOCAL_EXPORT_C_INCLUDES:.  I'm surprised that's not a syntax error, that might be a Kati bug if make would have caught it.

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-platfo...@googlegroups.com.
To post to this group, send email to android-...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-platform.
For more options, visit https://groups.google.com/d/optout.

Kartik Aiyer

unread,
Jun 1, 2018, 1:26:57 PM6/1/18
to android-platform
Hi Colin,

Thanks for pointing out the extra colon. I was testing between using LOCAL_EXPORT_C_INCLUDES and LOCAL_EXPORT_C_INCLUDE_DIRS and I added the extra colon by mistake. I took the colon out and what I can see is that when i use LOCAL_EXPORT_C_INCLUDES, export_includes does not have the exported directory. However if I use LOCAL_EXPORT_C_INCLUDE_DIRS, the paths are listed. I was under the impression that LOCAL_EXPORT_C_INCLUDE_DIRS was the "Old" way and that LOCAL_EXPORT_C_INCLUDES is the new way to specify include folders for shared libs. Any idea how to determine which key is used ? My AOSP code base is maintained by QCOM so it could be some vendor specific change to the build scripts. 

To summarize, removing the typo colon and replacing LOCAL_EXPORT_C_INCLUDES with LOCAL_EXPORT_C_INCLUDE_DIRS fixed my problem. Thanks for responding and approving by topic so quickly. 

Kartik

Colin Cross

unread,
Jun 4, 2018, 1:45:23 PM6/4/18
to android-...@googlegroups.com
I think LOCAL_EXPORT_C_INCLUDES is used by the ndk build system and LOCAL_EXPORT_C_INCLUDE_DIRS is used by the platform build system.
Reply all
Reply to author
Forward
0 new messages