Skip to content

Commit ae7f26e

Browse files
committed
Check BCryptGenRandom correctly
1 parent 427e055 commit ae7f26e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ endif()
121121

122122
if(MSVC)
123123
cmake_push_check_state()
124-
check_symbol_exists(BCryptGenRandom bcrypt.h BCRYPT_AVAILABLE)
124+
set(CMAKE_REQUIRED_LIBRARIES bcrypt)
125+
check_symbol_exists(BCryptGenRandom Windows.h;bcrypt.h BCRYPT_AVAILABLE)
125126
cmake_pop_check_state()
126127
if(BCRYPT_AVAILABLE)
127128
target_link_libraries(${PROJECT_NAME} PRIVATE Bcrypt)

0 commit comments

Comments
 (0)