Skip to content

cppcheck: refactor cmake configuration

Frank Winklmeier requested to merge fwinkl/athena:cppcheck2 into main

Refactor of the cppcheck cmake configuration to make it usable also for full project builds and not only WorkDir:

  • Move the suppressions into their own cppcheck_suppress.txt file. Only the suppression of external include directories remains on the command line.
  • Configure this suppression file and some other general cppcheck options in CxxUtilsSettings using the same approach we already do for the gccchecker configuration.

The command line arguments of cppcheck are built from:

  1. Fixed command line arguments: --quiet --inline-suppr --template=gcc -D__CPPCHECK__ that always have to be used.
  2. Suppression rules for all externals.
  3. Athena-specific --suppressions-list (see above)
  4. User-modifiable cppcheck options with default value ATLAS_CPPCHECK_OPTIONS "--enable=warning,portability". These can be modified or augmented via cmake -DATLAS_CPPCHECK_OPTIONS=... .

As always, in order to enable cppcheck one has to have it available in the environment (e.g. via lsetup cppcheck).

cc @akraszna @sroe

Relates to ATLINFR-5443 and ATLINFR-5449.

Edited by Frank Winklmeier

Merge request reports

Loading