Call 'clang-format' on generated code for better readability
Description
The (operator) code generated by the dune-codegen generation
target is barely readable, but may contain errors. To better find these errors, 'clang-format' could be called on the generated code automatically during/after generation. In the future, this could become a general feature of dune-codegen
Proposal
- Have CMake search for
clang-format
. - If found, append the usage of
clang-format
to thegeneration
target usingadd_custom_command(TARGET generation POST_BUILD)
, see https://cmake.org/cmake/help/latest/command/add_custom_command.html#build-events