Compile SQLite to a Shared Library
Steps
- Download the the amalgamation (
sqlite.c
) from https://sqlite.org/download.html - Run the below command. Consider using compiler flags to enable certain features
CC -dynamiclib sqlite3.c -o libsqlite3.0.dylib -lm -lpthread
Cross Compiling
Leverage Zig’s builtin LLVM bundle to compile to any target.
export CC=zig cc -target aarch64-linux-musl