Skip to content

Commit 4d70020

Browse files
committed
Support crypto (AKA eay) with MSVC as well
1 parent 519a3f6 commit 4d70020

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

cmake/Modules/FindCRYPTO.cmake

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,19 @@
66
find_path(CRYPTO_INCLUDE_DIR openssl/crypto.h)
77

88
# Try to find the library
9-
find_library(CRYPTO_LIBRARY crypto)
9+
if(NOT MSVC)
10+
find_library(CRYPTO_LIBRARY crypto)
11+
else()
12+
if(USE_STATIC_RT)
13+
set(OPENSSL_MSVC_STATIC_RT 1)
14+
endif()
15+
find_package(OpenSSL QUIET)
16+
# going the extra mile...
17+
set(CRYPTO_LIBRARY_RELEASE ${LIB_EAY_RELEASE})
18+
set(CRYPTO_LIBRARY_DEBUG ${LIB_EAY_DEBUG})
19+
include(SelectLibraryConfigurations)
20+
select_library_configurations(CRYPTO)
21+
endif()
1022

1123
include(FindPackageHandleStandardArgs)
1224
find_package_handle_standard_args(CRYPTO

0 commit comments

Comments
 (0)