Page MenuHomePhabricator

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

Authored by Fabien on Jan 16 2020, 14:34.

Details

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).

Diff Detail

Repository
rABC Bitcoin ABC
Branch
cmake_debug_same_defaults
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 8978
Build 15921: Default Diff Build & Tests
Build 15920: arc lint + arc unit