Subject:
Re: [ruby-ffi] [Q] search paths for loading libraries
From:
Wayne Meissner
Date:
5/6/10 5:38 PM
To:
ruby-ffi@googlegroups.com

On 7 May 2010 08:31, Jeremy Voorhis <jvoorhis@gmail.com> wrote:
> Is it only possible to specify complete, absolute paths to libraries for
> ffi_lib? An api similar to Ruby's $: would be convenient for adding
> directories to the load path, like FFI.load_paths << '/usr/local/lib'.

It would be fairly trivial to add ffi_library_path on a per-module
basis.  I'm not sure whether adding it globally is such a good idea -
one library can potentially screw another one over that way.

If anyone wants to hack on it, look in lib/ffi/library.rb in the
ffi_lib method.  Both ruby-ffi and JRuby use the same code for that
section, so a patch for one should apply to the other.