xmrig/cmake/OpenSSL.cmake

34 lines
944 B
CMake
Raw Normal View History

2018-09-16 00:06:54 +00:00
if (WITH_TLS)
set(OPENSSL_ROOT_DIR ${XMRIG_DEPS})
if (WIN32)
set(OPENSSL_USE_STATIC_LIBS TRUE)
set(OPENSSL_MSVC_STATIC_RT TRUE)
set(EXTRA_LIBS ${EXTRA_LIBS} Crypt32)
2019-11-16 11:56:34 +00:00
elseif (APPLE)
set(OPENSSL_USE_STATIC_LIBS TRUE)
endif()
2018-09-16 00:06:54 +00:00
find_package(OpenSSL)
if (OPENSSL_FOUND)
2019-03-14 18:50:35 +00:00
set(TLS_SOURCES src/base/net/stratum/Tls.h src/base/net/stratum/Tls.cpp)
2018-09-16 00:06:54 +00:00
include_directories(${OPENSSL_INCLUDE_DIR})
2019-04-09 07:06:56 +00:00
if (WITH_HTTP)
set(TLS_SOURCES ${TLS_SOURCES} src/base/net/http/HttpsClient.h src/base/net/http/HttpsClient.cpp)
endif()
2018-09-16 00:06:54 +00:00
else()
message(FATAL_ERROR "OpenSSL NOT found: use `-DWITH_TLS=OFF` to build without TLS support")
endif()
2019-03-15 19:07:26 +00:00
add_definitions(/DXMRIG_FEATURE_TLS)
2018-09-16 00:06:54 +00:00
else()
set(TLS_SOURCES "")
set(OPENSSL_LIBRARIES "")
2019-03-15 19:07:26 +00:00
remove_definitions(/DXMRIG_FEATURE_TLS)
2018-11-10 20:18:56 +00:00
set(CMAKE_PROJECT_NAME "${CMAKE_PROJECT_NAME}-notls")
2018-09-16 00:06:54 +00:00
endif()