HomePhabricator

[CMAKE] Use the same debug flags for C and C++

Description

[CMAKE] Use the same debug flags for C and C++

Summary:
This diff extends the some Debug compilation flags to also apply to the
C files. Now they can use -g3 when available as well as -ftrapv.

The optimization level remains unchanged for now. It can likely be
improved but having the same -O0 optimization causes ASAN to fail on
assembly code with Clang, so it needs special care.

Test Plan:

cmake -GNinja .. -DCMAKE_BUILD_TYPE=Debug
ninja -v check-all

Check in the output that the -g3 flag is used for both C and C++
(I couldn't find a compiler that doesn't support -g3).

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D4960

Details

Provenance
FabienAuthored on Jan 16 2020, 11:29
nakihitoPushed on Jan 16 2020, 22:49
Reviewer
Restricted Project
Differential Revision
D4960: [CMAKE] Use the same debug flags for C and C++
Parents
rSTAGING784629a8ed62: [CMAKE] Remove useless remove_compile_flag in leveldb
Branches
Unknown
Tags
Unknown