Skip to content

Commit

Permalink
Hardcode shared library extension to .so
Browse files Browse the repository at this point in the history
Evidently that's what Ruby expects it to be, regardless of target OS.
  • Loading branch information
malept committed Oct 5, 2017
1 parent c21024e commit 57880e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/thermite/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def library_name
#
def cargo_shared_library
@cargo_shared_library ||= begin
filename = shared_library
filename = "#{library_name}.#{shared_ext}"
filename = "lib#{filename}" unless Gem.win_platform?
filename
end
Expand All @@ -122,7 +122,7 @@ def cargo_shared_library
# The basename of the Rust shared library, as installed in the {#ruby_extension_path}.
#
def shared_library
@shared_library ||= "#{library_name}.#{shared_ext}"
@shared_library ||= "#{library_name}.so"
end

#
Expand Down
4 changes: 2 additions & 2 deletions test/lib/thermite/config_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ def test_shared_library
config.stubs(:library_name).returns('foobar')
config.stubs(:shared_ext).returns('ext')
Gem.stubs(:win_platform?).returns(false)
assert_equal 'foobar.ext', config.shared_library
assert_equal 'foobar.so', config.shared_library
end

def test_shared_library_windows
config.stubs(:library_name).returns('foobar')
config.stubs(:shared_ext).returns('ext')
Gem.stubs(:win_platform?).returns(true)
assert_equal 'foobar.ext', config.shared_library
assert_equal 'foobar.so', config.shared_library
end

def test_cargo_shared_library
Expand Down

0 comments on commit 57880e6

Please sign in to comment.