test multiple crypto libraries on multiple versions of windows

(Cherry-pick 6aa4e785c9)
This commit is contained in:
Tomas Maly
2023-07-30 13:49:09 +02:00
committed by Fletcher Dunn
parent 1dda79ed4d
commit 66fdb92bb1
+11 -9
View File
@@ -84,15 +84,17 @@ if (WIN32)
string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
#
# Check whether BCrypt can be used with this SDK version
#
cmake_push_check_state()
set(CMAKE_REQUIRED_LIBRARIES bcrypt)
check_symbol_exists(BCryptEncrypt windows.h BCRYPT_AVAILABLE)
cmake_pop_check_state()
if (NOT BCRYPT_AVAILABLE AND USE_CRYPTO STREQUAL "BCrypt")
message(FATAL_ERROR "You're on Windows but BCrypt seems to be unavailable, you will need OpenSSL")
if (USE_CRYPTO STREQUAL "BCrypt")
#
# Check whether BCrypt can be used with this SDK version
#
cmake_push_check_state()
set(CMAKE_REQUIRED_LIBRARIES bcrypt)
check_symbol_exists(BCryptEncrypt windows.h BCRYPT_AVAILABLE)
cmake_pop_check_state()
if (NOT BCRYPT_AVAILABLE)
message(FATAL_ERROR "You're on Windows but BCrypt seems to be unavailable, you will need OpenSSL")
endif()
endif()
endif()