build: replace WERROR with CMAKE_COMPILE_WARNING_AS_ERROR

-Werror is added to the previous releases job, given it runs on Ubuntu
22.04, which uses an older CMake.

`--compile-no-warning-as-error` can be used, if needed, in future, to
suppress the `CMAKE_COMPILE_WARNING_AS_ERROR` behaviour from a CI
config.

CMAKE_COMPILE_WARNING_AS_ERROR was added to CMake in 3.24.
See https://cmake.org/cmake/help/latest/prop_tgt/COMPILE_WARNING_AS_ERROR.html.

Co-authored-by: willcl-ark <will8clark@gmail.com>
This commit is contained in:
fanquakeandwillcl-ark committed 2026-02-05 16:39:14 +00:00
1 parent eb97250421
commit 322c4ec442
5 files changed
+8 -24

No files matched your search

@@ -15,13 +15,14 @@ export TEST_RUNNER_EXTRA="--previous-releases --coverage --extended --exclude fe
export GOAL="install"
export CI_LIMIT_STACK_SIZE=1
export DOWNLOAD_PREVIOUS_RELEASES="true"
# Use -Werror as the CMake version does not support CMAKE_COMPILE_WARNING_AS_ERROR
export BITCOIN_CONFIG="\
--preset=dev-mode \
-DREDUCE_EXPORTS=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS='-funsigned-char' \
-DCMAKE_C_FLAGS='-funsigned-char -Werror' \
-DCMAKE_C_FLAGS_DEBUG='-g2 -O2' \
-DCMAKE_CXX_FLAGS='-funsigned-char' \
-DCMAKE_CXX_FLAGS='-funsigned-char -Werror' \
-DCMAKE_CXX_FLAGS_DEBUG='-g2 -O2' \
-DAPPEND_CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE' \
"
+1 -4
View File
@@ -81,13 +81,10 @@ if [ "$DOWNLOAD_PREVIOUS_RELEASES" = "true" ]; then
test/get_previous_releases.py --target-dir "$PREVIOUS_RELEASES_DIR"
fi
BITCOIN_CONFIG_ALL="-DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON"
BITCOIN_CONFIG_ALL="-DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON"
if [ -z "$NO_DEPENDS" ]; then
BITCOIN_CONFIG_ALL="${BITCOIN_CONFIG_ALL} -DCMAKE_TOOLCHAIN_FILE=$DEPENDS_DIR/$HOST/toolchain.cmake"
fi
if [ -z "$NO_WERROR" ]; then
BITCOIN_CONFIG_ALL="${BITCOIN_CONFIG_ALL} -DWERROR=ON"
fi
ccache --zero-stats