Fix the clang compiler flag detection
The clang compiler accepts *any* compiler flags, and just reports an annoying warning instead: warning: unknown warning option '-Wsomething' [-Wunknown-warning-option] Use -Werror=unknown-warning-option to change this warning into an error, and detect the unsupported flag. Since this is a clang specific option, it can't be used unconditionally with other compilers. The option is also only used for checking the compiler flags, and not for compiling the code.
This commit is contained in:
parent
007a2bc835
commit
a4d771956a
@ -177,6 +177,7 @@ AC_CHECK_FUNCS([clock_gettime mach_absolute_time])
|
||||
AC_CHECK_FUNCS([getopt_long])
|
||||
|
||||
# Checks for supported compiler options.
|
||||
AX_APPEND_COMPILE_FLAGS([-Werror=unknown-warning-option],[ERROR_CFLAGS])
|
||||
AX_APPEND_COMPILE_FLAGS([ \
|
||||
-pedantic \
|
||||
-Wall \
|
||||
@ -192,7 +193,7 @@ AX_APPEND_COMPILE_FLAGS([ \
|
||||
-Wmissing-declarations \
|
||||
-Wno-unused-parameter \
|
||||
-fmacro-prefix-map='$(top_srcdir)/'= \
|
||||
])
|
||||
],,[$ERROR_CFLAGS])
|
||||
|
||||
# Windows specific compiler options.
|
||||
AS_IF([test "$platform" = "windows"], [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user