From b819f7e9392d25db6705a6bd3c92be3bb91775e2 Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Fri, 14 Oct 2022 23:30:14 +0530 Subject: [PATCH] Fix linking with non-MSVC toolchain in Windows platform This adds the link libraries in CMakeLists.txt file. If the libraries are not in CMake files linking failed with undefined reference error. Change-Id: I8f8352f6149a6332eedc0be51f36634890e3db60 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/54805 Commit-Queue: David Benjamin Reviewed-by: David Benjamin --- crypto/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index b6f08b09d..beb8bd806 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -470,6 +470,10 @@ endif() SET_TARGET_PROPERTIES(crypto PROPERTIES LINKER_LANGUAGE C) +if(WIN32) + target_link_libraries(crypto ws2_32) +endif() + if(NOT ANDROID) find_package(Threads REQUIRED) target_link_libraries(crypto Threads::Threads)