diff options
author | Mataes <mataes2007@gmail.com> | 2018-04-27 20:39:22 +0300 |
---|---|---|
committer | Mataes <mataes2007@gmail.com> | 2018-04-27 20:39:22 +0300 |
commit | b9ce1d4d98525490ca1a38e2d9fd4f3369adb3e0 (patch) | |
tree | 787c80a909776c1c4d099b638c83c7977bb070e2 /libs/tdlib/td/sqlite/CMakeLists.txt | |
parent | 5ed0126c16d061d6e87aa20c718e14608c66feec (diff) |
added tdlib library
Diffstat (limited to 'libs/tdlib/td/sqlite/CMakeLists.txt')
-rw-r--r-- | libs/tdlib/td/sqlite/CMakeLists.txt | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/libs/tdlib/td/sqlite/CMakeLists.txt b/libs/tdlib/td/sqlite/CMakeLists.txt new file mode 100644 index 0000000000..c94efe4f57 --- /dev/null +++ b/libs/tdlib/td/sqlite/CMakeLists.txt @@ -0,0 +1,52 @@ +cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) + +if (NOT OPENSSL_FOUND) + find_package(OpenSSL REQUIRED) + find_package(ZLIB REQUIRED) +endif() + +set(SQLITE_SOURCE + sqlite/sqlite3.c + + sqlite/sqlite3.h + sqlite/sqlite3ext.h + sqlite/sqlite3session.h +) + +add_library(tdsqlite STATIC ${SQLITE_SOURCE}) +target_include_directories(tdsqlite PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>) +target_include_directories(tdsqlite SYSTEM PRIVATE ${OPENSSL_INCLUDE_DIR}) +target_link_libraries(tdsqlite PRIVATE ${OPENSSL_CRYPTO_LIBRARY} ${CMAKE_DL_LIBS} ${ZLIB_LIBRARIES}) +target_compile_definitions(tdsqlite PRIVATE + -DSQLITE_DEFAULT_MEMSTATUS=0 + -DSQLITE_OMIT_LOAD_EXTENSION + -DSQLITE_OMIT_DECLTYPE + -DSQLITE_OMIT_PROGRESS_CALLBACK + #-DSQLITE_OMIT_DEPRECATED # SQLCipher uses deprecated sqlite3_profile + #-DSQLITE_OMIT_SHARED_CACHE +) +target_compile_definitions(tdsqlite PRIVATE -DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=2 -DSQLITE_ENABLE_FTS5 -DSQLITE_DISABLE_LFS) + +if (NOT WIN32) + target_compile_definitions(tdsqlite PRIVATE -DHAVE_USLEEP -DNDEBUG=1) +endif() + +if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") + target_compile_definitions(tdsqlite PRIVATE -DSQLITE_OS_WINRT=1) +endif() + +if (GCC OR CLANG) + target_compile_options(tdsqlite PRIVATE -Wno-deprecated-declarations -Wno-unused-variable -Wno-unused-const-variable -Wno-unused-function) + if (CLANG) + target_compile_options(tdsqlite PRIVATE -Wno-parentheses-equality -Wno-unused-value) + endif() +elseif (MSVC) + target_compile_options(tdsqlite PRIVATE /wd4996) +endif() + +install(TARGETS tdsqlite EXPORT TdTargets + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin + INCLUDES DESTINATION include +) |