During the integration of libsecp256k1’s build system into Bitcoin Core’s build system, it was decided to always build the most tested “RelWithDebInfo” configuration, regardless of the Bitcoin Core’s actual build configuration.
To achieve this goal for muli-config generators, we assign to each CMAKE_C_FLAGS_<CONFIG>
variable the default value of the CMAKE_C_FLAGS_RELWITHDEBINFO
variable before processing libsecp256k1’s CMakeLists.txt
file.
The problem with this approach is that, at this point, the CMAKE_C_FLAGS_RELWITHDEBINFO
variable has not yet been stripped of the -DNDEBUG
flag, which leaks into other CMAKE_C_FLAGS_<CONFIG>
variables.
This PR fixes this issue.