[Mesa-dev] [PATCH 2/2] Android: EGL: fix missing nativewindow.h include on O
cwhuang at android-x86.org
Fri Aug 25 05:39:08 UTC 2017
2017-08-24 22:02 GMT+08:00 Rob Herring <robh at kernel.org>:
> On Thu, Aug 24, 2017 at 4:08 AM, Chih-Wei Huang <cwhuang at android-x86.org> wrote:
>> 2017-08-24 1:25 GMT+08:00 Rob Herring <robh at kernel.org>:
>> I'm also trying to fix it.
>> Seems it only requires the headers instead
>> of the shared library. Adding libnativewindow to
>> LOCAL_SHARED_LIBRARIES would add the
>> unnecessary dependency to libGLES_mesa.so.
> Then the correct way to do this is LOCAL_HEADER_LIBRARIES instead.
Right. Unfortunately these two libs don't define
cc_library_headers in their Android.bp
so we can't use it.
>> Locally I fixed it in this way:
>> diff --git a/src/egl/Android.mk b/src/egl/Android.mk
>> index 4ccbb9b..9e96aca 100644
>> --- a/src/egl/Android.mk
>> +++ b/src/egl/Android.mk
>> @@ -43,6 +43,8 @@ LOCAL_CFLAGS := \
>> LOCAL_C_INCLUDES := \
>> + frameworks/native/libs/arect/include \
>> + frameworks/native/libs/nativewindow/include \
> Doing external includes this way is exactly what we don't want to do.
> There's a defined way to do cross project headers.
But better than add extra unnecessary dependency IMO.
Fortunately we have a much better solution
as suggested by Emil.
I just tested it and it works as expected.
Since it only needs the name ANativeWindow,
forward declaration fits the purpose perfectly.
More information about the mesa-dev