Hey!
I am building the static library to import into our Kotlin Multiplatform project as we do not want to bring in the overhead of cocoapods.
The commands that ended up working for me was this:
./configure --enable-tempstore=yes --with-crypto-lib=commoncrypto CFLAGS="
-DSQLITE_HAS_CODEC
-DSQLITE_TEMP_STORE=3
-DSQLCIPHER_CRYPTO_CC
-DSQLITE_SOUNDEX
-DSQLITE_THREADSAFE
-DSQLITE_ENABLE_RTREE
-DSQLITE_ENABLE_STAT3
-DSQLITE_ENABLE_STAT4
-DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_LOAD_EXTENSION -DSQLITE_ENABLE_UNLOCK_NOTIFY
-DSQLITE_ENABLE_FTS3_PARENTHESIS
-DSQLITE_ENABLE_FTS4
-DSQLITE_ENABLE_FTS4_UNICODE61
-DSQLITE_ENABLE_JSON1
-DSQLITE_ENABLE_FTS5
-DHAVE_USLEEP=1
-DSQLITE_MAX_VARIABLE_NUMBER=99999"
LDFLAGS="/usr/local/Cellar/openssl@3/3.0.0_1/lib/libcrypto.a"
make sqlite3.c
`xcrun --sdk iphoneos --find clang` -x c -target arm64-apple-ios8.0 -isysroot `xcrun --sdk iphoneos --show-sdk-path` -fmodules -DSQLITE_HAS_CODEC=1 -fstrict-aliasing -fembed-bitcode-marker -DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=3 -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_STAT3 -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_LOAD_EXTENSION -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS4_UNICODE61 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLCIPHER_CRYPTO_CC -DHAVE_USLEEP=1 -DSQLITE_MAX_VARIABLE_NUMBER=99999 -DNDEBUG -DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=3 -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_STAT3 -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_LOAD_EXTENSION -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS4_UNICODE61 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLCIPHER_CRYPTO_CC -DHAVE_USLEEP=1 -DSQLITE_MAX_VARIABLE_NUMBER=99999 -fno-objc-arc -fmodule-name=SQLCipher -Oz -fno-common -c sqlite3.c -o sqlite3.o
`xcrun --sdk iphoneos --find libtool` -static -syslibroot `xcrun --sdk iphoneos --show-sdk-path` -o libSQLCipher.a sqlite3.o
This creates the .a file which I bring into our cinterop folder and create the .def file.
I know this works as sqlite3_open() is found.
However sqlite3_key can’t be found. I see in the .h file
/* BEGIN SQLCIPHER */
#ifdef SQLITE_HAS_CODEC
/*
** Specify the key for an encrypted database. This routine should be
** called right after sqlite3_open().
**
** The code to implement this API is not available in the public release
** of SQLite.
*/
SQLITE_API int sqlite3_key(
sqlite3 *db, /* Database to be rekeyed */
const void *pKey, int nKey /* The key */
);
SQLITE_API int sqlite3_key_v2(
sqlite3 *db, /* Database to be rekeyed */
const char *zDbName, /* Name of the database */
const void *pKey, int nKey /* The key */
);
So I know it should be there. I’m assuming there is something wrong in my build process.
Any help would be fantastic!
Thanks