mruby-io: restore Windows link library dropped during HAL migration

Commit 9965f11cfe1c ("mruby-io: migrate HAL to ports/ directories")
moved the Windows HAL source into mruby-io/ports/win/ but dropped the
linker.libraries declaration that previously lived in
hal-win-io/mrbgem.rake. Both mingw and MSVC builds now fail to link
with undefined references to closesocket, WSAStartup, WSACleanup,
select, and WSAGetLastError referenced from io.c and io_hal.c.
Re-declare 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:11 +09:00
parent 22df8d61be
commit 3f27eac308
+4
View File
@@ -5,4 +5,8 @@ MRuby::Gem::Specification.new('mruby-io') do |spec|
spec.build.defines << "HAVE_MRUBY_IO_GEM"
spec.add_test_dependency 'mruby-time', core: 'mruby-time'
if spec.for_windows?
spec.linker.libraries << "ws2_32"
end
end