Use handy LIBSUFFIX from ffi
This commit is contained in:
@@ -1,14 +1,8 @@
|
|||||||
require 'ffi'
|
require 'ffi'
|
||||||
|
|
||||||
if RUBY_PLATFORM.include?('darwin')
|
|
||||||
EXT = 'dylib'
|
|
||||||
else
|
|
||||||
EXT = 'so'
|
|
||||||
end
|
|
||||||
|
|
||||||
module Hello
|
module Hello
|
||||||
extend FFI::Library
|
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
|
attach_function :double_input, [ :int ], :int
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user