Add default -Wall -Werror or -Wall.
* When -Wno-error and -Werror are not used:
add -Wall to the front of cflags
if the project is in the WarningAllowedProjects,
otherwise add -Wall -Werror.
* Add -Wall -Werror to ndk_library build targets.
* Collect names of modules with -Wno-error or without -Werror,
and pass them to makefile variables:
SOONG_MODULES_USING_WNO_ERROR
SOONG_MODULES_ADDED_WERROR
SOONG_MODULES_ADDED_WALL
* Generate ANDROID_WARNING_ALLOWED_PROJECTS for old makefiles.
Bug: 66996870
Test: normal build
Change-Id: I31385e12b80ca946c7395a5a184ef259b029aac6
diff --git a/cc/ndk_library.go b/cc/ndk_library.go
index c517523..96a90fb 100644
--- a/cc/ndk_library.go
+++ b/cc/ndk_library.go
@@ -251,6 +251,8 @@
"-Wno-incompatible-library-redeclaration",
"-Wno-builtin-requires-header",
"-Wno-invalid-noreturn",
+ "-Wall",
+ "-Werror",
// These libraries aren't actually used. Don't worry about unwinding
// (avoids the need to link an unwinder into a fake library).
"-fno-unwind-tables",