Amend commit 397fcd4663 (cmJSONState: Allow input stream as input,
2026-02-06) so that all constructors which feed into `ReadJSONStream`
bail on BOMs.
Add a test case for dynamic analysis tools.
When CMake is linked against a sufficiently new jsoncpp supporting
exceptions, and built with the configuration to enable it, we can more
gracefully recover from runtime errors when parsing bad inputs.
The caller for `GetErrorMessage` _should_ only be calling this method
if there actual errors (i.e., `!errors.empty()`). However, in the
incidental absence of the intended usage, avoid `pop_back` on an empty
string.
When the version of JsonCpp permits it, use StructuredErrors to generate
error messages for parse errors in the same style as other CMake-generated
JSON error messages.
Fixes: #26717
This improves the output of JSON-related error messages. It adds the filename to
the output and excludes the column number.
This is particularly useful when there are multiple JSON files being read that
could be responsible for an error, ie CMakePresets.json and
CMakeUserPresets.json, or multiple instrumentation queries.
Issue: #26717
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`, now with "east const" enforcement.
Use `clang-format` version 18.
* If you reached this commit for a line in `git blame`, re-run the blame
operation starting at the parent of this commit to see older history
for the content.
* See the parent commit for instructions to rebase a change across this
style transition commit.
Issue: #26123
`include-what-you-use` diagnostics, in practice, are specific to
the environment's compiler and standard library. Update includes
to satisfy IWYU for our CI job under Debian 12.