Skip to content

Commit

Permalink
Skip building on TruffleRuby
Browse files Browse the repository at this point in the history
  • Loading branch information
andrykonchin committed Sep 23, 2024
1 parent aad5a3b commit 341265c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
10 changes: 7 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ namespace :version do
end
end

require 'rake/extensiontask'
Rake::ExtensionTask.new("fiddle")
Rake::ExtensionTask.new("-test-/memory_view")
if RUBY_ENGINE == 'ruby'
require 'rake/extensiontask'
Rake::ExtensionTask.new("fiddle")
Rake::ExtensionTask.new("-test-/memory_view")
else
task :compile
end

task :default => [:compile, :test]
5 changes: 5 additions & 0 deletions ext/fiddle/extconf.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# frozen_string_literal: true
require 'mkmf'

if RUBY_ENGINE != 'ruby'
File.write('Makefile', dummy_makefile("").join)
return
end

# :stopdoc:

def gcc?
Expand Down
9 changes: 8 additions & 1 deletion lib/fiddle.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# frozen_string_literal: true

require 'fiddle.so'
if RUBY_ENGINE == "ruby"
require 'fiddle.so'
else
$LOAD_PATH.delete(__dir__)
require 'fiddle' # load from stdlib
return
end

require 'fiddle/closure'
require 'fiddle/function'
require 'fiddle/version'
Expand Down

0 comments on commit 341265c

Please sign in to comment.