From ae7f26ed445b9ed62542ac0520393ea3ce118948 Mon Sep 17 00:00:00 2001 From: paperchalice Date: Wed, 29 Jan 2025 19:05:43 +0800 Subject: [PATCH] Check BCryptGenRandom correctly --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 91bf402e8..468652177 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,7 +121,8 @@ endif() if(MSVC) cmake_push_check_state() - check_symbol_exists(BCryptGenRandom bcrypt.h BCRYPT_AVAILABLE) + set(CMAKE_REQUIRED_LIBRARIES bcrypt) + check_symbol_exists(BCryptGenRandom Windows.h;bcrypt.h BCRYPT_AVAILABLE) cmake_pop_check_state() if(BCRYPT_AVAILABLE) target_link_libraries(${PROJECT_NAME} PRIVATE Bcrypt)