mirror of
https://github.com/ruby/ruby.git
synced 2026-10-28 16:36:20 +08:00
rustc builds yjit.lib, which is linked into miniruby and the DLL directly. Archiving it into the static library would make mkexports.rb export every Rust symbol under a mangled name that does not exist, so a YJIT build does not install the static library. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
705 B
Ruby
29 lines
705 B
Ruby
require 'rbconfig'
|
|
|
|
module JITSupport
|
|
module_function
|
|
|
|
def yjit_supported?
|
|
return @yjit_supported if defined?(@yjit_supported)
|
|
@yjit_supported = ![nil, 'no'].include?(RbConfig::CONFIG['YJIT_SUPPORT'])
|
|
end
|
|
|
|
def yjit_enabled?
|
|
defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled?
|
|
end
|
|
|
|
def yjit_force_enabled?
|
|
"#{RbConfig::CONFIG['CFLAGS']} #{RbConfig::CONFIG['CPPFLAGS']}".match?(/(\A|\s)-D ?YJIT_FORCE_ENABLE\b/)
|
|
end
|
|
|
|
def zjit_supported?
|
|
return @zjit_supported if defined?(@zjit_supported)
|
|
# nil in mswin
|
|
@zjit_supported = ![nil, 'no'].include?(RbConfig::CONFIG['ZJIT_SUPPORT'])
|
|
end
|
|
|
|
def zjit_enabled?
|
|
defined?(RubyVM::ZJIT) && RubyVM::ZJIT.enabled?
|
|
end
|
|
end
|