diff options
author | Ashish Sadanandan <asadanan@qti.qualcomm.com> | 2023-03-31 22:41:48 -0600 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-04-25 11:18:36 -0400 |
commit | fcacc319d9e1a3ea89b33d58c495f32199f6ec91 (patch) | |
tree | ad24130e5248add80048e78691658d618d585d2d /Tests/CMakeTests/ListTest.cmake.in | |
parent | e256e35daa79732a200883cef398fcd0f8227a3d (diff) | |
download | cmake-fcacc319d9e1a3ea89b33d58c495f32199f6ec91.tar.gz |
IWYU: Return error code if user enables error reporting
Previously CMake ignored the return code from iwyu because old versions
of the tool would exit with an error code even when no header include
violations were detected. The iwyu project has since changed this
behavior, so the tool no longer returns an error code unless the user
enables error reporting via command line arguments.
Behavior seen with iwyu version 0.19
Source file with missing includes:
- Case 1: iwyu arguments:
- return code: 0
- output: <report of all missing includes>
- Case 2: iwyu arguments: `-Xiwyu --error`
- return code: 1
- output: <report of all missing includes>
Source file with no missing includes:
- Case 1: iwyu arguments:
- return code: 0
- output: `(/path/to/file.cc has correct #includes/fwd-decls)`
- Case 2: iwyu arguments: `-Xiwyu --error`
- return code: 0
- output: `(/path/to/file.cc has correct #includes/fwd-decls)`
Teach CMake to return the iwyu return code if the user has invoked the
tool with any of these command line arguments included:
- `--error[=N]`
- `--error_always[=N]`
Fixes: #24066
Diffstat (limited to 'Tests/CMakeTests/ListTest.cmake.in')
0 files changed, 0 insertions, 0 deletions