From e94b19031f0ab2207db984ce670f904fb582fcf5 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Wed, 22 Mar 2023 18:53:33 +0100 Subject: [PATCH] CMakeLists.txt: when using libsecp256k1 on windows we need to link with bcrypt.lib --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b6f0f7..4fe6c14 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,6 +86,12 @@ if (${EC_LIB} STREQUAL "libsecp256k1") src/libsecp256k1/ecdsa.cpp ) + # Need to link to bcrypt on windows as BCryptGenRandom is + # used by fill_random in src/libsecp256k1/rng.h + if (WIN32) + target_link_libraries( ${LIB_NAME} PRIVATE "bcrypt.lib" ) + endif (WIN32) + elseif (${EC_LIB} STREQUAL "openssl") target_sources( ${LIB_NAME} PRIVATE src/openssl/ec.cpp