Open d3x0r opened 2 months ago
My understanding is that a RelWithDebugInfo cmake build should see the exact same source code as a Release cmake build. For either of them, I'd expect _DEBUG to not be defined.
other than it says 'With Debug Info' ...it's not part of visual studio's default practices... but even so...
https://github.com/libressl/portable/blob/master/crypto/compat/posix_win.c#L155
has no specification of debug or release, so it will just build if MSVC, which under release will fail or relwithdebug info (since they should both link against release runtime) regardless of whether debug in the app/library is enabled.
https://learn.microsoft.com/en-us/cpp/c-runtime-library/debug?view=msvc-170 should make it clear enough.
266 has a reference to
_CrtSetReportMode
so I assume it was added because of this'_CrtSetReportMode' is only available in the debug c runtime... according to https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/crtsetreportmode?view=msvc-170
Libraries: Debug versions of the C runtime libraries only.
Unfortunately _DEBUG which is normally defined by Visual studio default projects isn't set when cmake generates the project file (without additional code in the cmakelists)
But then RelWithDebugInfo cmake builds link against release runtime, but should also have _DEBUG enabled... I added a few lines like the following to the cmake lists and then put
#if defined _MSC_VER && _MSC_VER >= 1900 && defined( _DEBUG ) && !defined( _REL_DEBUG )
around the code incrypto\compat\posix_win.c
that defines using_CrtSetReportMode
..as a side note, NDEBUG is defined for release builds of projects created by Visual Studio, and again, not by CMake.