Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

cmake_minimum_required(VERSION 3.12.3)

project(SQLite
LANGUAGES C)

set(CMAKE_POSITION_INDEPENDENT_CODE YES)

add_library(SQLite3
Sources/CSQLite/sqlite3.c)
if(CMAKE_SYSTEM_NAME STREQUAL Windows AND BUILD_SHARED_LIBS)
target_compile_definitions(SQLite3 PRIVATE
"SQLITE_API=__declspec(dllexport)")
endif()
target_include_directories(SQLite3 PUBLIC
Sources/CSQLite/include)

add_executable(sqlite
Sources/sqlite/shell.c)
target_compile_definitions(sqlite PRIVATE
SQLITE_OMIT_LOAD_EXTENSION)
target_link_libraries(sqlite PRIVATE
SQLite3)

install(TARGETS SQLite3
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
install(FILES
Sources/CSQLite/include/sqlite3.h
Sources/CSQLite/include/sqlite3ext.h
DESTINATION
include)