Use handy LIBSUFFIX from ffi

This commit is contained in:
Luc Street
2017-07-06 18:14:26 -07:00
committed by GitHub
parent 7347c5be6c
commit 30f7e308d3

View File

@@ -1,14 +1,8 @@
require 'ffi'
if RUBY_PLATFORM.include?('darwin')
EXT = 'dylib'
else
EXT = 'so'
end
module Hello
extend FFI::Library
ffi_lib 'target/debug/libdouble_input.' + EXT
ffi_lib 'target/debug/libdouble_input.' + FFI::Platform::LIBSUFFIX
attach_function :double_input, [ :int ], :int
end