Enable -Werror for Clang builds in CI

Don't enable for local dev builds or for GCC CI builds, as every
compiler version has a different set of warnings and trying to make them
all pass is a neverending task.
This commit is contained in:
Alastair Robertson 2023-05-22 03:02:47 -07:00 committed by Alastair Robertson
parent 280f663eb5
commit 5c691f27f7

View File

@ -9,6 +9,7 @@ workflows:
name: build-gcc name: build-gcc
cc: /usr/bin/gcc cc: /usr/bin/gcc
cxx: /usr/bin/g++ cxx: /usr/bin/g++
warnings_as_errors: "OFF"
- test: - test:
name: test-gcc name: test-gcc
requires: requires:
@ -21,6 +22,7 @@ workflows:
name: build-clang name: build-clang
cc: /usr/bin/clang-12 cc: /usr/bin/clang-12
cxx: /usr/bin/clang++-12 cxx: /usr/bin/clang++-12
warnings_as_errors: "ON"
- test: - test:
name: test-clang name: test-clang
requires: requires:
@ -72,6 +74,8 @@ jobs:
type: string type: string
cxx: cxx:
type: string type: string
warnings_as_errors:
type: string
environment: environment:
CC: << parameters.cc >> CC: << parameters.cc >>
CXX: << parameters.cxx >> CXX: << parameters.cxx >>
@ -115,7 +119,7 @@ jobs:
- run: - run:
name: Build name: Build
command: | command: |
cmake -G Ninja -B build/ -DWITH_FLAKY_TESTS=Off -DCODE_COVERAGE=On cmake -G Ninja -B build/ -DWITH_FLAKY_TESTS=Off -DCODE_COVERAGE=On -DWARNINGS_AS_ERRORS=<< parameters.warnings_as_errors >>
cmake --build build/ cmake --build build/
# Testing rubbish: # Testing rubbish:
cp test/ci.oid.toml build/testing.oid.toml cp test/ci.oid.toml build/testing.oid.toml