Gitlab CI: Enable -Werror with Clang builds

Enable -Werror so Clang specific warnings will trigger a build
error and can't be checked-in.

This requires disabling "extra" warnings.

Add explicit ENABLE_WERROR=ON options instead of relying on defaults.
This commit is contained in:
João Valverde 2022-11-15 16:56:19 +00:00
parent e1d492e2e0
commit 006f10f108
1 changed files with 3 additions and 3 deletions

View File

@ -509,7 +509,7 @@ GCC Release Build:
# build-ubuntu puts us in `build`. # build-ubuntu puts us in `build`.
- printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)" - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
# Test release build. # Test release build.
- CC=gcc CXX=g++ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DENABLE_CCACHE=ON -G Ninja .. - CC=gcc CXX=g++ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DENABLE_CCACHE=ON -DENABLE_WERROR=ON -G Ninja ..
- printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)" - printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
- script --command ninja --flush --quiet --return ../gcc_report.txt - script --command ninja --flush --quiet --return ../gcc_report.txt
- ansi2html < ../gcc_report.txt > ../gcc_report.html - ansi2html < ../gcc_report.txt > ../gcc_report.html
@ -522,7 +522,7 @@ GCC Release Build:
paths: paths:
- gcc_report.html - gcc_report.html
Code Checks + Clang Warnings: Clang + Code Checks:
extends: .build-ubuntu extends: .build-ubuntu
rules: !reference [.if-merge-request] rules: !reference [.if-merge-request]
variables: variables:
@ -540,7 +540,7 @@ Code Checks + Clang Warnings:
- cd build - cd build
- printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)" - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
# We don't have an "All options" job, so build fuzzshark and tfshark here. # We don't have an "All options" job, so build fuzzshark and tfshark here.
- cmake -DENABLE_EXTRA_COMPILER_WARNINGS=on -DENABLE_WERROR=off -DENABLE_CHECKHF_CONFLICT=on -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DBUILD_fuzzshark=ON -DBUILD_tfshark=On -DBUILD_logray=ON -DENABLE_CCACHE=ON -G Ninja .. - cmake -DENABLE_CHECKHF_CONFLICT=on -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DBUILD_fuzzshark=ON -DBUILD_tfshark=On -DBUILD_logray=ON -DENABLE_CCACHE=ON -DENABLE_WERROR=ON -G Ninja ..
- printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)" - printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
- mkdir ../html - mkdir ../html
- script --command ninja --flush --quiet --return ../tmp_clang_report.txt - script --command ninja --flush --quiet --return ../tmp_clang_report.txt