Skip to content

Commit 33105bc

Browse files
committed
Build the extension library only when CRuby (Fix #69)
On JRuby no C compiler is available and this call results in a runtime error.
1 parent c5e8246 commit 33105bc

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Rakefile

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
require "bundler/gem_tasks"
22
require "rake/testtask"
3-
require "ruby-core/extensiontask"
43

5-
helper = Bundler::GemHelper.instance
6-
extask = RubyCore::ExtensionTask.new(helper.gemspec)
7-
task :test => :compile
4+
if RUBY_ENGINE == "ruby"
5+
require "ruby-core/extensiontask"
6+
helper = Bundler::GemHelper.instance
7+
extask = RubyCore::ExtensionTask.new(helper.gemspec)
8+
task :test => :compile
9+
end
810

911
Rake::TestTask.new(:test) do |t|
10-
t.libs.unshift(*extask.libs)
12+
t.libs.unshift(*extask.libs) if extask
1113
t.libs << "test/lib"
1214
t.ruby_opts << "-rhelper"
1315
t.test_files = FileList["test/**/test_*.rb"]

ext/win32/resolv/extconf.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require 'mkmf'
2-
if have_library('iphlpapi', 'GetNetworkParams')
2+
if RUBY_ENGINE == "ruby" and have_library('iphlpapi', 'GetNetworkParams')
33
create_makefile('win32/resolv')
44
else
55
File.write('Makefile', "all clean install:\n\t@echo Done: $(@)\n")

0 commit comments

Comments
 (0)