diff --git a/cmake/OpenSSL.cmake b/cmake/OpenSSL.cmake index d0c0d1641..ed287e7e3 100644 --- a/cmake/OpenSSL.cmake +++ b/cmake/OpenSSL.cmake @@ -1,7 +1,12 @@ if (WITH_TLS) set(OPENSSL_ROOT_DIR ${XMRIG_DEPS}) - set(OPENSSL_USE_STATIC_LIBS TRUE) - set(OPENSSL_MSVC_STATIC_RT TRUE) + + if (WIN32) + set(OPENSSL_USE_STATIC_LIBS TRUE) + set(OPENSSL_MSVC_STATIC_RT TRUE) + + set(EXTRA_LIBS ${EXTRA_LIBS} Crypt32) + endif() find_package(OpenSSL) @@ -11,10 +16,6 @@ if (WITH_TLS) else() message(FATAL_ERROR "OpenSSL NOT found: use `-DWITH_TLS=OFF` to build without TLS support") endif() - - if (WIN32) - set(EXTRA_LIBS ${EXTRA_LIBS} Crypt32) - endif() else() set(TLS_SOURCES "") set(OPENSSL_LIBRARIES "")