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

ValveSoftware/GameNetworkingSockets#232
This commit is contained in:
Sam V
2022-06-13 16:43:55 +02:00
committed by Fletcher Dunn
parent 9a61630e5e
commit db3a9f70f7
2 changed files with 14 additions and 0 deletions
+8
View File
@@ -48,6 +48,14 @@ easier. Be sure to pick the installers **without** the "Light"suffix. In this in
For CMake to find the libraries, you may need to set the environment variable For CMake to find the libraries, you may need to set the environment variable
`OPENSSL_ROOT_DIR`. `OPENSSL_ROOT_DIR`.
If you are linking statically with OpenSSL you will need to set `OPENSSL_USE_STATIC_LIBS` to `ON`.
`OPENSSL_MSVC_STATIC_RT` is automatically matched to the value of `MSVC_CRT_STATIC`.
Both need to be set before any calls to `find_package(OpenSSL REQUIRED)` because CMake caches the paths to libraries.
When building GameNetworkingSockets by itself it is sufficient to set these variables on the command line or in the GUI before first configuration.
See the documentation for [FindOpenSSL](https://cmake.org/cmake/help/latest/module/FindOpenSSL.html) for more information about CMake variables involing OpenSSL.
#### Protobuf #### Protobuf
Instructions for getting a working installation of google protobuf on Windows can Instructions for getting a working installation of google protobuf on Windows can
+6
View File
@@ -97,6 +97,12 @@ if (WIN32)
endif() endif()
if (USE_CRYPTO STREQUAL "OpenSSL") if (USE_CRYPTO STREQUAL "OpenSSL")
# Match the OpenSSL runtime to our setting.
# Note that once found the library paths are cached and will not change if the option is changed.
if (MSVC)
set(OPENSSL_MSVC_STATIC_RT ${MSVC_CRT_STATIC})
endif()
find_package(OpenSSL REQUIRED) find_package(OpenSSL REQUIRED)
message( STATUS "OPENSSL_INCLUDE_DIR = ${OPENSSL_INCLUDE_DIR}" ) message( STATUS "OPENSSL_INCLUDE_DIR = ${OPENSSL_INCLUDE_DIR}" )