Skip to content

Commit c4f1db9

Browse files
committed
Fix sqlite3mc build for wasm
1 parent 82474fd commit c4f1db9

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

sqlite3/assets/wasm/CMakeLists.txt

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ FetchContent_Declare(
1818

1919
FetchContent_Declare(
2020
sqlite3mc
21-
URL https://github.com/utelle/SQLite3MultipleCiphers/releases/download/v2.0.1/sqlite3mc-2.0.1-sqlite-3.47.2-amalgamation.zip
21+
URL https://github.com/utelle/SQLite3MultipleCiphers/releases/download/v2.0.2/sqlite3mc-2.0.2-sqlite-3.48.0-amalgamation.zip
2222
DOWNLOAD_EXTRACT_TIMESTAMP NEW
2323
)
2424

@@ -51,7 +51,18 @@ macro(base_sqlite3_target name debug crypto)
5151
if(${crypto})
5252
list(APPEND sources "${sqlite3mc_SOURCE_DIR}/sqlite3mc_amalgamation.c")
5353
list(APPEND sources "${CMAKE_CURRENT_SOURCE_DIR}/getentropy.c")
54-
list(APPEND flags "-DSQLITE_OMIT_AUTOINIT")
54+
# We only want to support the chacha20 cipher, some of the others are tricky to
55+
# compile to webassembly.
56+
list(APPEND flags
57+
"-DSQLITE_OMIT_AUTOINIT"
58+
"-DHAVE_CIPHER_AES_128_CBC=0"
59+
"-DHAVE_CIPHER_AES_256_CBC=0"
60+
"-DHAVE_CIPHER_SQLCIPHER=0"
61+
"-DHAVE_CIPHER_RC4=0"
62+
"-DHAVE_CIPHER_ASCON128=0"
63+
"-DHAVE_CIPHER_AEGIS=0"
64+
"-DHAVE_CIPHER_CHACHA20=1"
65+
)
5566
else()
5667
list(APPEND sources "${sqlite3_SOURCE_DIR}/sqlite3.c")
5768
endif()

sqlite3/build.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ targets:
2929
enabled: false
3030

3131
$default:
32+
sources:
33+
include:
34+
- lib/**
35+
- example/web/**
3236
builders:
3337
build_web_compilers:entrypoint:
3438
generate_for:

0 commit comments

Comments
 (0)