Ver Fonte

Merge pull request #682 from paperchalice/cmake

Check BCryptGenRandom correctly
Steffen Jaeckel há 8 meses atrás
pai
commit
54f0456559
1 ficheiros alterados com 2 adições e 1 exclusões
  1. 2 1
      CMakeLists.txt

+ 2 - 1
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)