cmake: add warnings for MSVC static runtime option
This commit is contained in:
parent
867c169148
commit
258f2c958a
@ -65,6 +65,11 @@ if(MSVC)
|
|||||||
if(NOT DEFINED MSVC_RUNTIME)
|
if(NOT DEFINED MSVC_RUNTIME)
|
||||||
set(MSVC_RUNTIME "dynamic")
|
set(MSVC_RUNTIME "dynamic")
|
||||||
endif()
|
endif()
|
||||||
|
if(${MSVC_RUNTIME} STREQUAL "static")
|
||||||
|
message(STATUS "Use the MSVC static runtime option carefully!")
|
||||||
|
message(STATUS "OpenSSL uses /MD by default, and is very picky")
|
||||||
|
message(STATUS "Random freeing errors are a common sign of runtime issues")
|
||||||
|
endif()
|
||||||
configure_msvc_runtime()
|
configure_msvc_runtime()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -17,23 +17,22 @@ macro(configure_msvc_runtime)
|
|||||||
CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||||
)
|
)
|
||||||
if(${MSVC_RUNTIME} STREQUAL "static")
|
if(${MSVC_RUNTIME} STREQUAL "static")
|
||||||
message(STATUS
|
message(STATUS "MSVC: using statically-linked runtime (/MT and /MTd).")
|
||||||
"MSVC: using statically-linked runtime (/MT and /MTd)."
|
|
||||||
)
|
|
||||||
foreach(variable ${variables})
|
foreach(variable ${variables})
|
||||||
if(${variable} MATCHES "/MD")
|
if(${variable} MATCHES "/MD")
|
||||||
string(REGEX REPLACE "/MD" "/MT" ${variable} "${${variable}}")
|
string(REGEX REPLACE "/MD" "/MT" ${variable} "${${variable}}")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
else()
|
else()
|
||||||
message(STATUS
|
message(STATUS "MSVC: using dynamically-linked runtime (/MD and /MDd).")
|
||||||
"MSVC: using dynamically-linked runtime (/MD and /MDd)."
|
|
||||||
)
|
|
||||||
foreach(variable ${variables})
|
foreach(variable ${variables})
|
||||||
if(${variable} MATCHES "/MT")
|
if(${variable} MATCHES "/MT")
|
||||||
string(REGEX REPLACE "/MT" "/MD" ${variable} "${${variable}}")
|
string(REGEX REPLACE "/MT" "/MD" ${variable} "${${variable}}")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
foreach(variable ${variables})
|
||||||
|
set(${variable} "${${variable}}" CACHE STRING "MSVC_${variable}" FORCE)
|
||||||
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
endmacro(configure_msvc_runtime)
|
endmacro(configure_msvc_runtime)
|
||||||
|
@ -52,7 +52,6 @@ static CryptoCert tls_get_certificate(rdpTls* tls, boolean peer)
|
|||||||
|
|
||||||
static void tls_free_certificate(CryptoCert cert)
|
static void tls_free_certificate(CryptoCert cert)
|
||||||
{
|
{
|
||||||
|
|
||||||
X509_free(cert->px509);
|
X509_free(cert->px509);
|
||||||
xfree(cert);
|
xfree(cert);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user