Skip to content

Commit 76452c2

Browse files
committed
All Android targets need help finding the liblog folder for SQLCipher
1 parent 0ddff80 commit 76452c2

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

external/openssl-cmake/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ if(CMAKE_CROSSCOMPILING)
164164
# /usr/lib/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/x86_64-linux-android/asm/
165165
if(CMAKE_ANDROID_ARCH_ABI MATCHES x86_64)
166166
set(deps_CFLAGS "${deps_CFLAGS} -I${ANDROID_TOOLCHAIN_ROOT}/sysroot/usr/include/x86_64-linux-android")
167-
elseif()
167+
else()
168168
set(deps_CFLAGS "${deps_CFLAGS} -I${ANDROID_TOOLCHAIN_ROOT}/sysroot/usr/include/i686-linux-android")
169169
endif()
170170
endif()

external/sqlcipher-cmake/CMakeLists.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,12 @@ else()
126126
endif()
127127

128128
if(ANDROID)
129-
# NOTE: x86 build seems to have trouble finding -llog, help it find it by specifying the
130-
# library path
131-
if(CMAKE_ANDROID_ARCH_ABI MATCHES x86)
132-
set(sqlcipher_ldflags "${sqlcipher_ldflags} -L${ANDROID_TOOLCHAIN_ROOT}/sysroot/usr/lib/i686-linux-android/${ANDROID_PLATFORM_LEVEL} -lm")
133-
endif()
129+
# NOTE: SQLCipher seems to have trouble finding liblog and libm which is in this folder here
130+
# in the sysroot
131+
set(sqlcipher_ldflags "${sqlcipher_ldflags} -L${ANDROID_TOOLCHAIN_ROOT}/sysroot/usr/lib/${android_toolchain_prefix}-${android_toolchain_suffix}/${ANDROID_PLATFORM_LEVEL}")
134132

135133
# NOTE: SQLite uses __android_log_print and __android_log_write which is in their liblog library
136-
set(sqlcipher_ldflags "${sqlcipher_ldflags} -llog")
134+
set(sqlcipher_ldflags "${sqlcipher_ldflags} -lm -llog")
137135
endif()
138136

139137
set(sqlcipher_cflags "${sqlcipher_cflags} -DSQLCIPHER_CRYPTO_OPENSSL -I${OPENSSL_INCLUDE_DIRS}")

0 commit comments

Comments
 (0)