1- cmake_minimum_required (VERSION 3.10 )
1+ cmake_minimum_required (VERSION 3.15 )
22
33# If vcpkg present as submodule, bring in the toolchain
44if ( EXISTS ${CMAKE_SOURCE_DIR } /vcpkg/scripts/buildsystems/vcpkg.cmake )
@@ -33,7 +33,6 @@ if(SANITIZE_ADDRESS OR SANITIZE_THREAD OR SANITIZE_MEMORY OR SANITIZE_UNDEFINED)
3333 set (SANITIZE ON )
3434endif ()
3535
36- include (FlagsMSVC )
3736add_definitions ( -DVALVE_CRYPTO_ENABLE_25519 )
3837if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
3938 add_definitions (
@@ -51,11 +50,6 @@ option(LTO "Enable Link-Time Optimization" OFF)
5150option (ENABLE_ICE "Enable support for NAT-punched P2P connections using ICE protocol. Build native ICE client" ON )
5251option (USE_STEAMWEBRTC "Build Google's WebRTC library to get ICE support for P2P" OFF )
5352option (Protobuf_USE_STATIC_LIBS "Link with protobuf statically" OFF )
54- if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
55- option (MSVC_CRT_STATIC "Link the MSVC CRT statically" OFF )
56- configure_msvc_runtime ()
57- print_default_msvc_flags ()
58- endif ()
5953
6054#
6155# Primary crypto library (for AES, SHA256, etc)
@@ -99,8 +93,8 @@ endif()
9993if (USE_CRYPTO STREQUAL "OpenSSL" )
10094 # Match the OpenSSL runtime to our setting.
10195 # Note that once found the library paths are cached and will not change if the option is changed.
102- if (MSVC )
103- set (OPENSSL_MSVC_STATIC_RT ${MSVC_CRT_STATIC} )
96+ if (MSVC AND CMAKE_MSVC_RUNTIME_LIBRARY MATCHES "^MultiThreaded($|Debug$)" )
97+ set (OPENSSL_MSVC_STATIC_RT TRUE )
10498 endif ()
10599
106100 find_package (OpenSSL REQUIRED )
0 commit comments