Skip to content

Commit 0ddff80

Browse files
committed
Assist SQLCipher in finding the liblog directory
1 parent 909e955 commit 0ddff80

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

external/openssl-cmake/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,11 @@ if(CMAKE_CROSSCOMPILING)
162162
# /usr/lib/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/linux/types.h:9:10: fatal error: 'asm/types.h' file not found
163163
# At
164164
# /usr/lib/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/x86_64-linux-android/asm/
165-
set(deps_CFLAGS "${deps_CFLAGS} -I${ANDROID_TOOLCHAIN_ROOT}/sysroot/usr/include/x86_64-linux-android")
165+
if(CMAKE_ANDROID_ARCH_ABI MATCHES x86_64)
166+
set(deps_CFLAGS "${deps_CFLAGS} -I${ANDROID_TOOLCHAIN_ROOT}/sysroot/usr/include/x86_64-linux-android")
167+
elseif()
168+
set(deps_CFLAGS "${deps_CFLAGS} -I${ANDROID_TOOLCHAIN_ROOT}/sysroot/usr/include/i686-linux-android")
169+
endif()
166170
endif()
167171
endif()
168172
endif()

external/sqlcipher-cmake/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +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()
134+
129135
# NOTE: SQLite uses __android_log_print and __android_log_write which is in their liblog library
130136
set(sqlcipher_ldflags "${sqlcipher_ldflags} -llog")
131137
endif()

0 commit comments

Comments
 (0)