HomePhabricator

[CMAKE] Add a facility to add flag groups and use it for -Wformat-*

Description

[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

Details

Provenance
FabienAuthored on Jun 1 2020, 11:19
FabienPushed on Jun 1 2020, 13:46
Reviewer
Restricted Project
Differential Revision
D6311: [CMAKE] Add a facility to add flag groups and use it for -Wformat-*
Parents
rABC394c628f0ea9: [CMAKE] Allow for checking support for several flags at the same time
Branches
Unknown
Tags
Unknown