Top Level Namespace

Defined Under Namespace

Modules: GLib, GObject, Vips

Instance Method Summary collapse

Instance Method Details

#library_name(name, abi_number) ⇒ Object

Generate a library name for ffi.

Platform notes: linux: Some distros allow “libvips.so”, but only if the -dev headers have been installed. To work everywhere, you must include the ABI number. Confusingly, the file extension is not at the end. ffi adds the “lib” prefix. mac: As linux, but the extension is at the end and is added by ffi. windows: The ABI number must be included, but with a hyphen. ffi does not add a “lib” prefix or a “.dll” suffix.



26
27
28
29
30
31
32
33
34
# File 'lib/vips.rb', line 26

def library_name(name, abi_number)
  if FFI::Platform.windows?
    "lib#{name}-#{abi_number}.dll"
  elsif FFI::Platform.mac?
    "#{name}.#{abi_number}"
  else
    "#{name}.so.#{abi_number}"
  end
end