secp256k1 icon indicating copy to clipboard operation
secp256k1 copied to clipboard

cmake: Delete `-DNDEBUG` from all available config-specific flags

Open hebasto opened this issue 5 months ago • 3 comments

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.

hebasto avatar Sep 16 '24 17:09 hebasto