-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.9.2 fails to build in release mode on windows #1089
Comments
My understanding is that a RelWithDebugInfo cmake build should see the exact same source code as a Release cmake build. |
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.
The text was updated successfully, but these errors were encountered: