Skip to content

Commit

Permalink
Reallocate SQLite libs
Browse files Browse the repository at this point in the history
  • Loading branch information
awawa-dev committed May 31, 2024
1 parent 4d2b4c0 commit 95f7a83
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 44 deletions.
54 changes: 54 additions & 0 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,57 @@
#=============================================================================
# SQLite
#=============================================================================

add_library(sqlite3 "${CMAKE_CURRENT_SOURCE_DIR}/sqlite/sqlite3.c")
target_include_directories(sqlite3 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/sqlite")
target_link_libraries(sqlite3 PRIVATE ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})


set_target_properties(sqlite3 PROPERTIES
OUTPUT_NAME sqlite3
PUBLIC_HEADER sqlite3.h
)

target_compile_definitions(sqlite3 PUBLIC
SQLITE_THREADSAFE=2
SQLITE_DEFAULT_MEMSTATUS=0
SQLITE_DEFAULT_SYNCHRONOUS=3
SQLITE_OMIT_AUTHORIZATION
SQLITE_OMIT_AUTOINCREMENT
SQLITE_OMIT_AUTOMATIC_INDEX
SQLITE_OMIT_INCRBLOB
SQLITE_OMIT_AUTORESET
SQLITE_OMIT_AUTOVACUUM
SQLITE_OMIT_BETWEEN_OPTIMIZATION
SQLITE_OMIT_BLOB_LITERAL
SQLITE_OMIT_BTREECOUNT
SQLITE_OMIT_CHECK
SQLITE_OMIT_COMPILEOPTION_DIAGS
SQLITE_OMIT_COMPLETE
SQLITE_OMIT_DEPRECATED
SQLITE_OMIT_FLAG_PRAGMAS
SQLITE_OMIT_EXPLAIN
SQLITE_OMIT_FOREIGN_KEY
SQLITE_OMIT_GET_TABLE
SQLITE_OMIT_LIKE_OPTIMIZATION
SQLITE_OMIT_LOAD_EXTENSION
SQLITE_OMIT_OR_OPTIMIZATION
SQLITE_OMIT_PROGRESS_CALLBACK
SQLITE_OMIT_QUICKBALANCE
SQLITE_OMIT_SCHEMA_PRAGMAS
SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS
SQLITE_OMIT_TCL_VARIABLE
SQLITE_OMIT_TEMPDB
SQLITE_OMIT_TRACE
SQLITE_OMIT_TRUNCATE_OPTIMIZATION
SQLITE_OMIT_WAL
SQLITE_OMIT_XFER_OPT)

#=============================================================================
# RPi ws281x
#=============================================================================


if(ENABLE_WS281XPWM)
add_library(ws281x
${CMAKE_CURRENT_SOURCE_DIR}/rpi_ws281x/mailbox.c ${CMAKE_CURRENT_SOURCE_DIR}/rpi_ws281x/ws2811.c
Expand Down
File renamed without changes.
File renamed without changes.
45 changes: 1 addition & 44 deletions sources/db/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,47 +23,4 @@ if(USE_PRECOMPILED_HEADERS AND COMMAND target_precompile_headers)
target_precompile_headers(database REUSE_FROM precompiled_hyperhdr_headers)
endif()

add_library(sqlite3 "${CURRENT_SOURCE_DIR}/sqlite/sqlite3.c")
target_include_directories(sqlite3 PUBLIC "${CURRENT_SOURCE_DIR}/sqlite")
target_link_libraries(sqlite3 PUBLIC ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
target_link_libraries(database sqlite3)

set_target_properties(sqlite3 PROPERTIES
OUTPUT_NAME sqlite3
PUBLIC_HEADER sqlite3.h
)

target_compile_definitions(sqlite3 PUBLIC
SQLITE_THREADSAFE=2
SQLITE_DEFAULT_MEMSTATUS=0
SQLITE_DEFAULT_SYNCHRONOUS=3
SQLITE_OMIT_AUTHORIZATION
SQLITE_OMIT_AUTOINCREMENT
SQLITE_OMIT_AUTOMATIC_INDEX
SQLITE_OMIT_INCRBLOB
SQLITE_OMIT_AUTORESET
SQLITE_OMIT_AUTOVACUUM
SQLITE_OMIT_BETWEEN_OPTIMIZATION
SQLITE_OMIT_BLOB_LITERAL
SQLITE_OMIT_BTREECOUNT
SQLITE_OMIT_CHECK
SQLITE_OMIT_COMPILEOPTION_DIAGS
SQLITE_OMIT_COMPLETE
SQLITE_OMIT_DEPRECATED
SQLITE_OMIT_FLAG_PRAGMAS
SQLITE_OMIT_EXPLAIN
SQLITE_OMIT_FOREIGN_KEY
SQLITE_OMIT_GET_TABLE
SQLITE_OMIT_LIKE_OPTIMIZATION
SQLITE_OMIT_LOAD_EXTENSION
SQLITE_OMIT_OR_OPTIMIZATION
SQLITE_OMIT_PROGRESS_CALLBACK
SQLITE_OMIT_QUICKBALANCE
SQLITE_OMIT_SCHEMA_PRAGMAS
SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS
SQLITE_OMIT_TCL_VARIABLE
SQLITE_OMIT_TEMPDB
SQLITE_OMIT_TRACE
SQLITE_OMIT_TRUNCATE_OPTIMIZATION
SQLITE_OMIT_WAL
SQLITE_OMIT_XFER_OPT)
target_link_libraries(database sqlite3)

0 comments on commit 95f7a83

Please sign in to comment.