diff --git a/google/cloud/storage/CMakeLists.txt b/google/cloud/storage/CMakeLists.txt index 876d8c6fc89cb..bc15beb6c0f71 100644 --- a/google/cloud/storage/CMakeLists.txt +++ b/google/cloud/storage/CMakeLists.txt @@ -267,6 +267,11 @@ target_link_libraries( OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB) +if (WIN32) + # We use `setsockopt()` directly, which requires the ws2_32 (Winsock2 for + # Windows32?) library on Windows. + target_link_libraries(google_cloud_cpp_storage PUBLIC ws2_32) +endif () google_cloud_cpp_add_common_options(google_cloud_cpp_storage) target_include_directories( google_cloud_cpp_storage PUBLIC $