mruby-socket: restore Windows link libraries dropped during HAL migration

Commit d9e107c801 ("mruby-socket: migrate HAL to ports/ directories")
moved the Windows HAL source into mruby-socket/ports/win/ but dropped
the linker.libraries declarations that previously lived in
hal-win-socket/mrbgem.rake. Both mingw and MSVC builds now fail to
link with undefined references to WSAStartup, socket, send, and other
Winsock APIs. Re-declare wsock32 and ws2_32 under a for_windows? guard.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2026-04-23 23:16:02 +09:00
parent ad8fc7d918
commit 22df8d61be
+5
View File
@@ -8,4 +8,9 @@ MRuby::Gem::Specification.new('mruby-socket') do |spec|
spec.add_dependency('mruby-io', :core => 'mruby-io')
spec.add_dependency('mruby-error', :core => 'mruby-error')
# spec.add_dependency('mruby-mtest')
if spec.for_windows?
spec.linker.libraries << "wsock32"
spec.linker.libraries << "ws2_32"
end
end