Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] android: Include headers from libhardware as system headers
@ 2014-05-21 16:18 Andrzej Kaczmarek
  2014-05-22  7:32 ` Szymon Janc
  0 siblings, 1 reply; 3+ messages in thread
From: Andrzej Kaczmarek @ 2014-05-21 16:18 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Andrzej Kaczmarek

Including hardware/audio.h in Android build produces sign-compare
warning due to nested include of cutils/bitops.h. Since we cannot avoid
this warning in sane way unless it's fixed in AOSP tree, we can make
GCC think this is a system header and suppress warnings.

This patch changes the way headers from libhardware are added to
search path from LOCAL_C_INCLUDES to explicit "-isystem" option added
to LOCAL_CFLAGS.
---
 android/Android.mk | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/android/Android.mk b/android/Android.mk
index 4235a7c..d3d94ed 100644
--- a/android/Android.mk
+++ b/android/Android.mk
@@ -121,12 +121,12 @@ LOCAL_SRC_FILES := \
 
 LOCAL_C_INCLUDES += \
 	$(call include-path-for, system-core) \
-	$(call include-path-for, libhardware) \
 
 LOCAL_SHARED_LIBRARIES := \
 	libcutils \
 
-LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS)
+LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS) \
+	-isystem $(call include-path-for, libhardware)
 
 LOCAL_MODULE := bluetooth.default
 LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
@@ -163,9 +163,9 @@ LOCAL_SRC_FILES := \
 
 LOCAL_C_INCLUDES += \
 	$(call include-path-for, system-core) \
-	$(call include-path-for, libhardware) \
 
-LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS)
+LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS) \
+	-isystem $(call include-path-for, libhardware)
 
 LOCAL_SHARED_LIBRARIES := libhardware
 
@@ -256,14 +256,14 @@ LOCAL_SRC_FILES := bluez/android/hal-audio.c
 
 LOCAL_C_INCLUDES = \
 	$(call include-path-for, system-core) \
-	$(call include-path-for, libhardware) \
 	$(call include-path-for, sbc) \
 
 LOCAL_SHARED_LIBRARIES := \
 	libcutils \
 	libsbc \
 
-LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS)
+LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS) \
+	-isystem $(call include-path-for, libhardware)
 
 LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
 LOCAL_MODULE_TAGS := optional
@@ -281,14 +281,14 @@ LOCAL_SRC_FILES := bluez/android/hal-sco.c
 
 LOCAL_C_INCLUDES = \
 	$(call include-path-for, system-core) \
-	$(call include-path-for, libhardware) \
 	$(call include-path-for, audio-utils) \
 
 LOCAL_SHARED_LIBRARIES := \
 	libcutils \
 	libaudioutils \
 
-LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS)
+LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS) \
+	-isystem $(call include-path-for, libhardware)
 
 LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
 LOCAL_MODULE_TAGS := optional
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] android: Include headers from libhardware as system headers
  2014-05-21 16:18 [PATCH] android: Include headers from libhardware as system headers Andrzej Kaczmarek
@ 2014-05-22  7:32 ` Szymon Janc
  2014-05-22  7:59   ` Andrzej Kaczmarek
  0 siblings, 1 reply; 3+ messages in thread
From: Szymon Janc @ 2014-05-22  7:32 UTC (permalink / raw)
  To: Andrzej Kaczmarek; +Cc: linux-bluetooth

Hi Andrzej,

On Wednesday 21 of May 2014 18:18:02 Andrzej Kaczmarek wrote:
> Including hardware/audio.h in Android build produces sign-compare
> warning due to nested include of cutils/bitops.h. Since we cannot avoid
> this warning in sane way unless it's fixed in AOSP tree, we can make
> GCC think this is a system header and suppress warnings.
> 
> This patch changes the way headers from libhardware are added to
> search path from LOCAL_C_INCLUDES to explicit "-isystem" option added
> to LOCAL_CFLAGS.
> ---
>  android/Android.mk | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/android/Android.mk b/android/Android.mk
> index 4235a7c..d3d94ed 100644
> --- a/android/Android.mk
> +++ b/android/Android.mk
> @@ -121,12 +121,12 @@ LOCAL_SRC_FILES := \

I'd rather fix this in AOSP instead of hacking this in our build system.

-- 
Best regards, 
Szymon Janc

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] android: Include headers from libhardware as system headers
  2014-05-22  7:32 ` Szymon Janc
@ 2014-05-22  7:59   ` Andrzej Kaczmarek
  0 siblings, 0 replies; 3+ messages in thread
From: Andrzej Kaczmarek @ 2014-05-22  7:59 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth

Hi Szymon,

On 22 May 2014 09:32, Szymon Janc <szymon.janc@tieto.com> wrote:
> Hi Andrzej,
>
> On Wednesday 21 of May 2014 18:18:02 Andrzej Kaczmarek wrote:
>> Including hardware/audio.h in Android build produces sign-compare
>> warning due to nested include of cutils/bitops.h. Since we cannot avoid
>> this warning in sane way unless it's fixed in AOSP tree, we can make
>> GCC think this is a system header and suppress warnings.
>>
>> This patch changes the way headers from libhardware are added to
>> search path from LOCAL_C_INCLUDES to explicit "-isystem" option added
>> to LOCAL_CFLAGS.
>> ---
>>  android/Android.mk | 16 ++++++++--------
>>  1 file changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/android/Android.mk b/android/Android.mk
>> index 4235a7c..d3d94ed 100644
>> --- a/android/Android.mk
>> +++ b/android/Android.mk
>> @@ -121,12 +121,12 @@ LOCAL_SRC_FILES := \
>
> I'd rather fix this in AOSP instead of hacking this in our build system.

I agree, I pushed patch for this already:
https://android-review.googlesource.com/95341

BR,
Andrzej

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-22  7:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-21 16:18 [PATCH] android: Include headers from libhardware as system headers Andrzej Kaczmarek
2014-05-22  7:32 ` Szymon Janc
2014-05-22  7:59   ` Andrzej Kaczmarek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox