Adding an Include path from an upper Android.mk into a subdir module

396 views
Skip to first unread message

Kartik Aiyer

unread,
May 23, 2018, 9:58:09 AM5/23/18
to android-platform

Hello,

I have a project which has a structure as follows

.
├── Android.mk
├── cmake_android_all.sh
├── CMakeLists.txt
├── Core
│   ├── Android.mk

│   ├── Base
│   │   ├── Algorithm.cpp
│   │   ├── Algorithm.h
│   │   ├── Android.mk
│   │   ├── Apple
│   │   │   └── Math+Apple.hpp
│   │   ├── BitGrid.cpp
│   │   ├── BitGrid.h
│   │   ├── Circle.cpp
│   │   ├── Circle.h
│   │   ├── CMakeLists.txt
│   │   ├── Color.cpp
│   │   ├── Color.h
│   │   ├── FifoQueue.h
│   │   ├── Filter.cpp
│   │   ├── Filter.h
│   │   ├── LRUSmallCache.h
│   │   ├── Macros.h
│   │   ├── Math.cpp
│   │   ├── Math.hpp
│   │   ├── Memory.h
│   │   ├── NumberRange.h
│   │   ├── Obfuscator.h
│   │   ├── PixelBuffer.cpp
│   │   ├── PixelBuffer.h
│   │   ├── Platform.h
│   │   ├── Quaternion.cpp
│   │   ├── Quaternion.h
│   │   ├── Range.cpp
│   │   ├── Range.h
│   │   ├── Rect.cpp

│   │   ├── Rect.h
│   │   ├── Regex.h
│   │   ├── Sampling.cpp
│   │   ├── Sampling.h
│   │   ├── Serialization.cpp
│   │   ├── Serialization.h
│   │   ├── Slice.cpp
│   │   ├── Slice.h
│   │   ├── String.cpp
│   │   ├── String.hpp
│   │   ├── ThreadPool.h
│   │   ├── Types.cpp
│   │   └── Types.h
│   ├── Base.h

└── Vendor

    ├── Eigen
    │   ├── Eigen
    │   │   ├── Array
    │   │   ├── Cholesky
    │   │   ├── CholmodSupport
    │   │   ├── CMakeLists.txt
    │   │   ├── Core
    │   │   ├── Dense
    │   │   ├── Eigen
    │   │   ├── Eigen2Support
    │   │   ├── Eigenvalues
    │   │   ├── Geometry
    │   │   ├── Householder
    │   │   ├── IterativeLinearSolvers
    │   │   ├── Jacobi
    │   │   ├── LeastSquares
    │   │   ├── LU
    │   │   ├── MetisSupport
    │   │   ├── OrderingMethods
    │   │   ├── PardisoSupport
    │   │   ├── PaStiXSupport
    │   │   ├── QR
    │   │   ├── QtAlignedMalloc
    │   │   ├── Sparse
    │   │   ├── SparseCholesky
    │   │   ├── SparseCore
    │   │   ├── SparseLU
    │   │   ├── SparseQR
    │   │   ├── SPQRSupport
    │   │   ├── src
    │   │   │   ├── Cholesky

The root has an Android.mk, the Core folder has an Andoird.mk file and Core/Base has an Android.mk file.

Root Andoird.mk

CORE_ROOT_PATH := $(abspath $(call my-dir))
CORE_SRC_PATH := $(abspath $(call my-dir))/Core
CORE_VENDOR_PATH := $(abspath $(call my-dir))/Vendor
include $(call all-subdir-makefiles)

Core Android.mk

include $(call all-subdir-makefiles)

Base Andoird.mk

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
$(warning CORE VENDOR = $(CORE_VENDOR_PATH))
LOCAL_C_INCLUDES := $(CORE_ROOT_PATH)\
              $(CORE_VENDOR_PATH)/Eigen

LOCAL_SRC_FILES := $(call all-cpp-files-under, . )

LOCAL_MODULE := coreBase

include $(BUILD_STATIC_LIBRARY)

So ./Core/Base needs to some include files defined in ./Vendor/Eigen/

I want to add ./Vendor/Eigen as a LOCAL_C_INCLUDES search path for the Base module but this is failing with the line

build/core/binary.mk:1522: error: vendor/rylo/Core/Core/Base/Android.mk: coreBase: C_INCLUDES must be under the source or output directories: /home/kartik/Projects/qcom/vendor/rylo/Core /home/kartik/Projects/qcom/vendor/rylo/Co

It looks like I can’t use LOCAL_C_INCLUDES to add an include path that is outside of the Module Android.mk root path. How should I bring in that search path?

Thanks
Kartik

Kartik Aiyer

unread,
May 23, 2018, 5:25:23 PM5/23/18
to android-platform
Okay Silly me... I figured out after reading build/core/build-system.html that LOCAL_C_INCLUDES are specified releative to the TOP Android file. Please ignore.

Thanks
Kartik

--
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.

RMApps Solution

unread,
Aug 31, 2018, 1:05:56 PM8/31/18
to android-platform
How did you resolve this problem with C_INCLUDES, I put logs into mk file and got problem C_INCLUDES when Android.mk tries
include $(BUILD_STATIC_LIBRARY)
Have solution for this problem ?
Reply all
Reply to author
Forward
0 new messages