cmake: fix Windows check for CryptAcquireContext

Check for CryptAcquireContext in windows.h and wincrypt.h only, since
otherwise this check may fail due to third party headers not found.

Closes https://github.com/curl/curl/pull/10353
This commit is contained in:
ALittleDruid 2023-01-28 20:23:25 +08:00 committed by Jay Satiro
parent bf54c9382f
commit f5a88f2978

View File

@ -1277,7 +1277,7 @@ if(WIN32)
# Check if crypto functions in wincrypt.h are actually available
if(HAVE_WINCRYPT_H)
check_symbol_exists(CryptAcquireContext "${CURL_INCLUDES}" USE_WINCRYPT)
check_symbol_exists(CryptAcquireContext "windows.h;wincrypt.h" USE_WINCRYPT)
endif()
if(USE_WINCRYPT)
set(USE_WIN32_CRYPTO ON)