Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlite: use versioned library #1928

Merged
merged 1 commit into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion thirdparty/lua-ljsqlite3/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,14 @@ int sqlite3_create_function(
]]

-- --------------------------------------------------------------------------------
local sql = ffi.load("sqlite3")
local sql
if ffi.os == "Windows" then
sql = ffi.load("libs/sqlite3.dll")
elseif ffi.os == "OSX" then
sql = ffi.load("libs/libsqlite3.0.dylib")
else
sql = ffi.load("libs/libsqlite3.so.0")
end

local transient = ffi.cast("sqlite3_destructor_type", -1)
local int64_ct = ffi.typeof("int64_t")
Expand Down
6 changes: 3 additions & 3 deletions thirdparty/sqlite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ list(APPEND INSTALL_CMD COMMAND make
install-pkgconfigDATA
)

# FIXME: shouldn't the versioned `libsqlite3.so.0` be used?
set(LIB_SPEC sqlite3 VERSION 0)
if(APPLE)
append_shared_lib_fix_commands(INSTALL_CMD sqlite3 ID)
append_shared_lib_fix_commands(INSTALL_CMD ${LIB_SPEC} ID)
endif()
append_shared_lib_install_commands(INSTALL_CMD sqlite3)
append_shared_lib_install_commands(INSTALL_CMD ${LIB_SPEC})

external_project(
DOWNLOAD URL ff687dfc7483196420a4f16a6f53702d
Expand Down