Skip to content
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

Set OPENSSL_MSVC_STATIC_RT to value of MSVC_CRT_STATIC and update manual windows building instructions #232

Closed
SamVanheer opened this issue Jun 13, 2022 · 0 comments

Comments

@SamVanheer
Copy link
Contributor

SamVanheer commented Jun 13, 2022

The instructions for manually building on Windows do not cover certain CMake variables that affect the success of OpenSSL configuration in GameNetworkingSockets.

If you are linking statically with OpenSSL you will need to set OPENSSL_USE_STATIC_LIBS to ON.
If you are using a static runtime you will need to set OPENSSL_MSVC_STATIC_RT to ON.

Both need to be set before any calls to find_package(OpenSSL REQUIRED).

Otherwise the error noted in #118 (Cannot find EVP_MD_CTX_free) will occur. CMake does not report mismatched settings so it can be difficult to diagnose.

See https://cmake.org/cmake/help/latest/module/FindOpenSSL.html for the documentation for these variables, as well as any other variables that may be added in the future.

I don't know of any way to detect how binary-only libraries were configured so it's probably not possible to check if they're compatible, but FindOpenSSL does provide an OPENSSL_VERSION variable which may be an alternative to checking for the function that causes the error. This would eliminate the problem happening at configure time, but mixing runtimes will likely cause problems later on anyway.

Setting OPENSSL_MSVC_STATIC_RT to the value of MSVC_CRT_STATIC should help to avoid problems with incompatible runtimes.

@SamVanheer SamVanheer changed the title Update manual windows building instructions to refer to OpenSSL CMake documentation Set OPENSSL_MSVC_STATIC_RT to value of MSVC_CRT_STATIC and update manual windows building instructions Jun 13, 2022
zpostfacto pushed a commit that referenced this issue Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant