Link to the Windows standard libraries on Windows for ++

This commit is contained in:
Jackson Coxson
2025-08-12 13:39:41 -06:00
parent 7fbad8399f
commit 5477571a80

View File

@@ -56,6 +56,16 @@ foreach(EXAMPLE_FILE ${EXAMPLE_SOURCES})
"-framework IOKit" "-framework IOKit"
"-framework CFNetwork" "-framework CFNetwork"
) )
elseif (WIN32)
# System libs required by Rust std/tokio/reqwest/ring on Windows
target_link_libraries(${EXAMPLE_NAME} PRIVATE
ws2_32 # WSAStartup/WSACleanup, closesocket, freeaddrinfo
userenv # GetUserProfileDirectoryW
ntdll # NtReadFile, RtlNtStatusToDosError
bcrypt # ring RNG (BCryptGenRandom)
# iphlpapi # (optional) GetAdaptersAddresses, if you ever see it unresolved
# secur32 crypt32 ncrypt # (only if you switch to schannel/native-tls)
)
endif() endif()
endforeach() endforeach()