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

Tentative refactor of SQLite.jl #295

Closed
wants to merge 4 commits into from
Closed
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
3 changes: 0 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ version = "1.4.1"

[deps]
DBInterface = "a10d1c49-ce27-4219-8d33-6db1a4562965"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SQLite_jll = "76ed43ae-9a5d-5a62-8c75-30186b810ce8"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
WeakRefStrings = "ea10d353-3f73-51f8-a26c-33c1cb351aa5"

[compat]
Expand Down
7 changes: 7 additions & 0 deletions gen/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[deps]
Clang = "40e3b903-d033-50b4-a0cc-940c62c95e31"
SQLite_jll = "76ed43ae-9a5d-5a62-8c75-30186b810ce8"

[compat]
Clang = "0.15"
SQLite_jll = "3"
18 changes: 18 additions & 0 deletions gen/generate_wrapper.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Clang.Generators
using SQLite_jll

cd(@__DIR__)

include_dir = normpath(SQLite_jll.artifact_dir, "include")

options = load_options(joinpath(@__DIR__, "generator.toml"))

args = get_default_args()

headers = [joinpath(include_dir, "sqlite3.h")]

# create context
ctx = create_context(headers, args, options)

# run generator
build!(ctx)
14 changes: 14 additions & 0 deletions gen/generator.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[general]
library_name = "libsqlite"
output_file_path = "../src/capi.jl"
module_name = "C"
jll_pkg_name = "SQLite_jll"
print_using_CEnum = false
output_ignorelist = [
"SQLITE_STDCALL"
]

[codegen]
use_julia_bool = true
use_ccall_macro = true
opaque_func_arg_as_PtrCvoid = true
Loading