Use -Werror in frameworks/native/libs/vr
* Suppress/fix warnings of unused variable, parameter,
private-field, and function.
* Fix warnings about typedef missing declarator.
* Use -Wno-error to keep existing warnings, to fix later.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: Ifb82fcd76fcb5d9c9d9f017f2541581661493bd5
diff --git a/services/vr/hardware_composer/Android.bp b/services/vr/hardware_composer/Android.bp
index 5cb201d..88a5a611 100644
--- a/services/vr/hardware_composer/Android.bp
+++ b/services/vr/hardware_composer/Android.bp
@@ -43,6 +43,11 @@
cflags: [
"-DLOG_TAG=\"vr_hwc\"",
+ "-Wall",
+ "-Werror",
+ "-Wno-error=sign-compare", // fix later
+ "-Wno-unused-private-field",
+ "-Wno-unused-parameter",
],
}
@@ -56,6 +61,7 @@
"aidl/android/dvr/parcelable_composer_layer.cpp",
"aidl/android/dvr/parcelable_unique_fd.cpp",
],
+ cflags: ["-Wall", "-Werror"],
aidl: {
include_dirs: ["frameworks/native/services/vr/hardware_composer/aidl"],
export_aidl_headers: true,
@@ -91,6 +97,8 @@
],
cflags: [
"-DLOG_TAG=\"vr_hwc\"",
+ "-Wall",
+ "-Werror",
],
}
@@ -119,6 +127,8 @@
],
cflags: [
"-DLOG_TAG=\"vr_hwc\"",
+ "-Wall",
+ "-Werror",
],
init_rc: [
"vr_hwc.rc",
@@ -129,6 +139,12 @@
name: "vr_hwc_test",
gtest: true,
srcs: ["tests/vr_composer_test.cpp"],
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-error=sign-compare", // fix later
+ "-Wno-unused-parameter",
+ ],
static_libs: [
"libgtest",
"libvr_hwc-impl",