[CMAKE] Add a facility to add flag groups and use it for -Wformat-*
Summary:
The -Wformat-security option is dependent on -Wformat on GCC and will
throw a warning when cmake check for the flag alone. Using a flag group
fixes the issue.
Note that -Wformat ends up added twice, since it can be used alone if
supported. CMake will deduplicate the flags for us.
Depends on D6310.
Test Plan:
ninja -v all check-all
Check both flags are added to the command line (once each). Look at
CMakeFiles/CMakeOuptut.log and check there is no longer any warning
emitted when checking for -Wformat-security.
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D6311