fix: use package.searchpath to find libivyrs
Now we are useing the package.searchpath to find the libivyrs.so or libivyrs.dylib. This is so it will load the correct library or the OS you are on. This fixes the issues with loading the library on macOS. Ref: #57
This commit is contained in:
parent
100723f141
commit
9f665bf639
1 changed files with 3 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
local library_path = (function()
|
local library_path = (function()
|
||||||
local dirname = string.sub(debug.getinfo(1).source, 2, #"/fzf_lib.lua" * -1)
|
local root = string.sub(debug.getinfo(1).source, 2, #"/libivy.lua" * -1)
|
||||||
return dirname .. "/../../target/release/libivyrs.so"
|
local release_path = root .. "../../target/release"
|
||||||
|
return package.searchpath("libivyrs", release_path .. "/?.so;" .. release_path .. "/?.dylib;")
|
||||||
end)()
|
end)()
|
||||||
|
|
||||||
local ffi = require "ffi"
|
local ffi = require "ffi"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue