Fix compilation warnings and re-enable werror=yes on Travis
Fix -Wunused-variable, -Wunused-but-set-variable and -Wswitch warnings raised by GCC 8 and 9. Fix -Wunused-function, -Wunused-private-field and -Wtautological-constant-out-of-range-compare raised by Clang. Fix MSVC 2019 warning C4804 (unsafe use of type 'bool' in comparison operation). GCC -Wcpp warnings/Clang -W#warnings (`#warning`) are no longer raising errors and will thus not abort compilation with `werror=yes`. Treat glslang headers are system headers to avoid raising warnings. Re-enables us to build with `werror=yes` on Linux and macOS, thus catching warnings that would be introduced by new code. Fixes #36132.
This commit is contained in:
@ -58,7 +58,11 @@ if env['builtin_glslang']:
|
||||
|
||||
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
|
||||
|
||||
env_glslang.Prepend(CPPPATH=[thirdparty_dir])
|
||||
# Treat glslang headers as system headers to avoid raising warnings. Not supported on MSVC.
|
||||
if not env.msvc:
|
||||
env_glslang.Append(CPPFLAGS=['-isystem', Dir(thirdparty_dir).path])
|
||||
else:
|
||||
env_glslang.Prepend(CPPPATH=[thirdparty_dir])
|
||||
|
||||
env_thirdparty = env_glslang.Clone()
|
||||
env_thirdparty.disable_warnings()
|
||||
|
||||
Reference in New Issue
Block a user