Skip to content

Build with libsql. #235

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
19 changes: 10 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# dependencies
SQLITE_VERSION = version-3.47.0
SQLITE_TARBALL_URL = https://www.sqlite.org/src/tarball/sqlite.tar.gz?r=${SQLITE_VERSION}
LIBSQL_VERSION = v0.24.31
LIBSQL_TARBALL_URL = https://github.com/tursodatabase/libsql/archive/refs/tags/libsql-server-${LIBSQL_VERSION}.tar.gz

EXTENSION_FUNCTIONS = extension-functions.c
EXTENSION_FUNCTIONS_URL = https://www.sqlite.org/contrib/download/extension-functions.c?get=25
Expand All @@ -27,7 +27,7 @@ JSFILES = \

vpath %.c src
vpath %.c deps
vpath %.c deps/$(SQLITE_VERSION)
vpath %.c deps/$(LIBSQL_VERSION)

EXPORTED_FUNCTIONS = src/exported_functions.json
EXPORTED_RUNTIME_METHODS = src/extra_exported_runtime_methods.json
Expand All @@ -42,7 +42,7 @@ OBJ_FILES_DIST = $(patsubst %.c,tmp/obj/dist/%.o,$(CFILES))
EMCC ?= emcc

CFLAGS_COMMON = \
-I'deps/$(SQLITE_VERSION)' \
-I'deps/$(LIBSQL_VERSION)' \
-Wno-non-literal-null-conversion \
$(CFLAGS_EXTRA)
CFLAGS_DEBUG = -g $(CFLAGS_COMMON)
Expand Down Expand Up @@ -138,11 +138,12 @@ cache/$(EXTENSION_FUNCTIONS):
clean-deps:
rm -rf deps

deps/$(SQLITE_VERSION)/sqlite3.h deps/$(SQLITE_VERSION)/sqlite3.c:
mkdir -p cache/$(SQLITE_VERSION)
curl -LsS $(SQLITE_TARBALL_URL) | tar -xzf - -C cache/$(SQLITE_VERSION)/ --strip-components=1
mkdir -p deps/$(SQLITE_VERSION)
(cd deps/$(SQLITE_VERSION); ../../cache/$(SQLITE_VERSION)/configure --enable-all && make sqlite3.c)
deps/$(LIBSQL_VERSION)/sqlite3.h deps/$(LIBSQL_VERSION)/sqlite3.c:
mkdir -p cache/$(LIBSQL_VERSION)
curl -LsS $(LIBSQL_TARBALL_URL) \
| tar -xzf - -C cache/$(LIBSQL_VERSION)/ --strip-components=2 libsql-libsql-server-${LIBSQL_VERSION}/libsql-sqlite3/
mkdir -p deps/$(LIBSQL_VERSION)
(cd deps/$(LIBSQL_VERSION); ../../cache/$(LIBSQL_VERSION)/configure --enable-all && make sqlite3.c)

deps/$(EXTENSION_FUNCTIONS): cache/$(EXTENSION_FUNCTIONS)
mkdir -p deps
Expand Down
2 changes: 1 addition & 1 deletion dist/wa-sqlite-async.mjs

Large diffs are not rendered by default.

Binary file modified dist/wa-sqlite-async.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/wa-sqlite-jspi.mjs

Large diffs are not rendered by default.

Binary file modified dist/wa-sqlite-jspi.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/wa-sqlite.mjs

Large diffs are not rendered by default.

Binary file modified dist/wa-sqlite.wasm
Binary file not shown.
Loading