Fix kernel -Werror support

The introduction of secondary arch support for kernel files disabled
-Werror for all kernel files, since the -Werror flags were moved from
{CC,C++}FLAGS to TARGET_WARNING_{CC,C++}FLAGS_<arch>, which, however,
was overwritten by the SetupKernel rule. This commit introduces new
global variables {HAIKU,HOST,TARGET}_WERROR_FLAGS[_<arch>], which
contain the additional -Werror flags to be applied for the architecture.
The config variable WARNINGS can be set to "treatAsErrors" to cause
-Werror and {HOST,TARGET}_WERROR_FLAGS[_<arch>] to be appended to the
compilation flags.

Fixes #10280.
This commit is contained in:
Ingo Weinhold
2013-12-05 12:48:22 +01:00
parent 7b83ce1142
commit 724f4e2d38
4 changed files with 37 additions and 18 deletions
+7
View File
@@ -291,6 +291,9 @@ rule CreateAsmStructOffsetsHeader header : source
# warning flags
if $(WARNINGS) != 0 {
flags += $(HOST_WARNING_C++FLAGS) ;
if $(WARNINGS) = treatAsErrors {
flags += -Werror $(HOST_WERROR_FLAGS) ;
}
}
# debug and other flags
@@ -311,6 +314,10 @@ rule CreateAsmStructOffsetsHeader header : source
# warning flags
if $(WARNINGS) != 0 {
flags += $(TARGET_WARNING_C++FLAGS_$(TARGET_PACKAGING_ARCH)) ;
if $(WARNINGS) = treatAsErrors {
flags += -Werror
$(TARGET_WERROR_FLAGS_$(TARGET_PACKAGING_ARCH)) ;
}
}
# debug and other flags