mrbgem.rake: simplify hal selection logic

remove redundant visualcpp and mingw checks since for_windows? already
detects all windows builds including visual c++ and mingw.

ref #6653

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-10-27 11:10:17 +09:00
parent 28b567ae78
commit ad51bf848b
4 changed files with 4 additions and 20 deletions
-3
View File
@@ -8,9 +8,6 @@ MRuby::Gem::Specification.new('mruby-dir') do |spec|
# No HAL found - determine appropriate error message or auto-load
suggested_hal = if ENV['MRUBY_DIR_HAL']
ENV['MRUBY_DIR_HAL']
elsif spec.build.primary_toolchain == 'visualcpp'
# Visual C++ on Windows - use native Windows HAL
'hal-win-dir'
elsif spec.for_windows?
'hal-win-dir'
elsif RUBY_PLATFORM =~ /linux|darwin|bsd/
+1 -4
View File
@@ -10,10 +10,7 @@ MRuby::Gem::Specification.new('mruby-io') do |spec|
# HAL gems must be explicitly specified in build config (recommended) or via auto-selection below
spec.build.gems.one? { |g| g.name =~ /^hal-.*-io$/ } or begin
# No HAL found - determine appropriate error message or auto-load
suggested_hal = if spec.build.primary_toolchain == 'visualcpp'
# Visual C++ on Windows - use native Windows HAL
'hal-win-io'
elsif spec.for_windows?
suggested_hal = if spec.for_windows?
'hal-win-io'
elsif RUBY_PLATFORM =~ /linux|darwin|bsd/
'hal-posix-io'
+1 -4
View File
@@ -13,10 +13,7 @@ MRuby::Gem::Specification.new('mruby-socket') do |spec|
# HAL gems must be explicitly specified in build config (recommended) or via auto-selection below
spec.build.gems.one? { |g| g.name =~ /^hal-.*-socket$/ } or begin
# No HAL found - determine appropriate error message or auto-load
suggested_hal = if spec.build.primary_toolchain == 'visualcpp'
# Visual C++ on Windows - use native Windows HAL
'hal-win-socket'
elsif spec.for_windows?
suggested_hal = if spec.for_windows?
'hal-win-socket'
elsif RUBY_PLATFORM =~ /linux|darwin|bsd/
'hal-posix-socket'
+2 -9
View File
@@ -10,15 +10,8 @@ MRuby::Gem::Specification.new('mruby-task') do |spec|
# HAL gems must be explicitly specified in build config (recommended) or via auto-selection below
spec.build.gems.one? { |g| g.name =~ /^hal-.*-task$/ } or begin
# No HAL found - determine appropriate error message or auto-load
suggested_hal = if spec.build.primary_toolchain == 'visualcpp'
# Visual C++ on Windows - use native Windows HAL
'hal-win-task'
elsif (spec.build.kind_of?(MRuby::CrossBuild) && spec.build.host_target =~ /mingw/) ||
spec.cc.command.to_s =~ /mingw/ ||
RUBY_PLATFORM =~ /mingw/
# MinGW provides POSIX I/O but NOT POSIX signals - use Windows HAL
'hal-win-task'
elsif spec.for_windows?
suggested_hal = if spec.for_windows?
# Windows (including MinGW) - use Windows HAL
'hal-win-task'
elsif RUBY_PLATFORM =~ /linux|darwin|bsd/
'hal-posix-task'