mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-09 11:27:28 -03:00
ci, iwyu: Treat warnings as errors for specific targets
Currently, this applies only to the `bitcoin_clientversion` and `bitcoin_crypto` targets.
This commit is contained in:
parent
6df1a0ce23
commit
d838f1bac6
1 changed files with 8 additions and 0 deletions
|
@ -170,6 +170,7 @@ if [ "${RUN_TIDY}" = "true" ]; then
|
|||
echo "^^^ ⚠️ Failure generated from clang-tidy"
|
||||
false
|
||||
fi
|
||||
|
||||
# Filter out:
|
||||
# * qt qrc and moc generated files
|
||||
jq 'map(select(.file | test("src/qt/qrc_.*\\.cpp$|/moc_.*\\.cpp$") | not))' "${BASE_BUILD_DIR}/compile_commands.json" > tmp.json
|
||||
|
@ -180,6 +181,13 @@ if [ "${RUN_TIDY}" = "true" ]; then
|
|||
-- -Xiwyu --cxx17ns -Xiwyu --mapping_file="${BASE_ROOT_DIR}/contrib/devtools/iwyu/bitcoin.core.imp" \
|
||||
-Xiwyu --max_line_length=160 \
|
||||
2>&1 | tee /tmp/iwyu_ci.out
|
||||
|
||||
# TODO: Expand the following list to all targets.
|
||||
TARGETS_WITH_FORCED_IWYU="bitcoin_clientversion bitcoin_crypto"
|
||||
cd "${BASE_BUILD_DIR}"
|
||||
bash -c "cmake -S ${BASE_ROOT_DIR} -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE=\"include-what-you-use;-Xiwyu;--cxx17ns;-Xiwyu;--mapping_file=${BASE_ROOT_DIR}/contrib/devtools/iwyu/bitcoin.core.imp;-Xiwyu;--error\""
|
||||
bash -c "cmake --build . ${MAKEJOBS} --clean-first --target ${TARGETS_WITH_FORCED_IWYU}"
|
||||
|
||||
cd "${BASE_ROOT_DIR}/src"
|
||||
python3 "/include-what-you-use/fix_includes.py" --nosafe_headers < /tmp/iwyu_ci.out
|
||||
git --no-pager diff
|
||||
|
|
Loading…
Reference in a new issue