Skip to content

Commit

Permalink
Fix sqlite3mc build for wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
simolus3 committed Jan 17, 2025
1 parent 82474fd commit c4f1db9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
15 changes: 13 additions & 2 deletions sqlite3/assets/wasm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ FetchContent_Declare(

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

Expand Down Expand Up @@ -51,7 +51,18 @@ macro(base_sqlite3_target name debug crypto)
if(${crypto})
list(APPEND sources "${sqlite3mc_SOURCE_DIR}/sqlite3mc_amalgamation.c")
list(APPEND sources "${CMAKE_CURRENT_SOURCE_DIR}/getentropy.c")
list(APPEND flags "-DSQLITE_OMIT_AUTOINIT")
# We only want to support the chacha20 cipher, some of the others are tricky to
# compile to webassembly.
list(APPEND flags
"-DSQLITE_OMIT_AUTOINIT"
"-DHAVE_CIPHER_AES_128_CBC=0"
"-DHAVE_CIPHER_AES_256_CBC=0"
"-DHAVE_CIPHER_SQLCIPHER=0"
"-DHAVE_CIPHER_RC4=0"
"-DHAVE_CIPHER_ASCON128=0"
"-DHAVE_CIPHER_AEGIS=0"
"-DHAVE_CIPHER_CHACHA20=1"
)
else()
list(APPEND sources "${sqlite3_SOURCE_DIR}/sqlite3.c")
endif()
Expand Down
4 changes: 4 additions & 0 deletions sqlite3/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ targets:
enabled: false

$default:
sources:
include:
- lib/**
- example/web/**
builders:
build_web_compilers:entrypoint:
generate_for:
Expand Down

0 comments on commit c4f1db9

Please sign in to comment.