chore(build): support build lua-tiktoken on Windows (#128)
Signed-off-by: Hanchin Hsieh <me@yuchanns.xyz>
This commit is contained in:
@@ -7,6 +7,8 @@ H.get_os_name = function()
|
||||
return "linux"
|
||||
elseif os_name == "Darwin" then
|
||||
return "macOS"
|
||||
elseif os_name == "Windows_NT" then
|
||||
return "windows"
|
||||
else
|
||||
error("Unsupported operating system: " .. os_name)
|
||||
end
|
||||
@@ -14,7 +16,7 @@ end
|
||||
|
||||
H.library_path = function()
|
||||
local os_name = H.get_os_name()
|
||||
local ext = os_name == "linux" and "so" or "dylib"
|
||||
local ext = os_name == "linux" and "so" or (os_name == "macOS" and "dylib" or "dll")
|
||||
local dirname = string.sub(debug.getinfo(1).source, 2, #"/tiktoken_lib.lua" * -1)
|
||||
return dirname .. ("../build/?.%s"):format(ext)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user