1 Star 0 Fork 0

tickCoder-mirrors/koreader-koreader

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
setupkoenv.lua 992 Bytes
一键复制 编辑 原始数据 按行查看 历史
NiLuJe 提交于 2019-03-29 20:12 . A few minor fixes after #4847 (#4850)
-- set search path for 'require()'
package.path =
"common/?.lua;rocks/share/lua/5.1/?.lua;frontend/?.lua;" ..
package.path
package.cpath =
"common/?.so;common/?.dll;/usr/lib/lua/?.so;rocks/lib/lua/5.1/?.so;" ..
package.cpath
-- set search path for 'ffi.load()'
local ffi = require("ffi")
local dummy = require("ffi/posix_h")
local C = ffi.C
if ffi.os == "Windows" then
C._putenv("PATH=libs;common;")
end
local ffi_load = ffi.load
-- patch ffi.load for thirdparty luajit libraries
ffi.load = function(lib)
io.write("ffi.load: ", lib, "\n")
local loaded, re = pcall(ffi_load, lib)
if loaded then return re end
local lib_path = package.searchpath(lib, "./lib?.so;./libs/lib?.so;./libs/lib?.so.1")
if not lib_path then
io.write("ffi.load (warning): ", re, "\n")
error('Not able to load dynamic library: ' .. lib)
else
io.write("ffi.load (assisted searchpath): ", lib_path, "\n")
return ffi_load(lib_path)
end
end
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tickCoder-mirrors/koreader-koreader.git
git@gitee.com:tickCoder-mirrors/koreader-koreader.git
tickCoder-mirrors
koreader-koreader
koreader-koreader
master

搜索帮助