最近更新到了xcode 11.4.1,发现原来引入 s.dependency 'SQLCipher' 的pod package打包失败了,一查发现有个这样的错误:
error: implicit declaration of function 'sqlite3_key' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
在网上查了下,只要添加在 WARNING_CFLAGS 中添加 -Wno-implicit-function-declaration 即可解决。
以下是我的xcconfig配置:
s.xcconfig = {
'OTHER_CFLAGS' => '$(inherited) -DSQLITE_HAS_CODEC -DSQLITE_THREADSAFE -DSQLITE_TEMP_STORE=2 -DSQLCIPHER_CRYPTO_CC',
'OTHER_LDFLAGS' => '$(inherited) -framework Security'
'WARNING_CFLAGS' => '-Wno-implicit-function-declaration'
# 'OTHER_CPPFLAGS' => '$(inherited) -I/usr/local/opt/openssl/include',
# 'OTHER_LDFLAGS' => '$(inherited) -L/usr/local/opt/openssl/lib -framework Security'
}