aboutsummaryrefslogtreecommitdiff
path: root/ports/sqlite3
diff options
context:
space:
mode:
Diffstat (limited to 'ports/sqlite3')
-rw-r--r--ports/sqlite3/CMakeLists.txt29
-rw-r--r--ports/sqlite3/CONTROL9
-rw-r--r--ports/sqlite3/portfile.cmake26
3 files changed, 43 insertions, 21 deletions
diff --git a/ports/sqlite3/CMakeLists.txt b/ports/sqlite3/CMakeLists.txt
index dbe636b79..b4b105a65 100644
--- a/ports/sqlite3/CMakeLists.txt
+++ b/ports/sqlite3/CMakeLists.txt
@@ -1,31 +1,42 @@
cmake_minimum_required(VERSION 3.0)
project(sqlite3 C)
-include_directories(${SOURCE})
+include_directories(.)
if(BUILD_SHARED_LIBS)
set(API "-DSQLITE_API=__declspec(dllexport)")
else()
set(API "-DSQLITE_API=extern")
endif()
-add_library(sqlite3 ${SOURCE}/sqlite3.c)
+add_library(sqlite3 sqlite3.c)
-
-target_compile_definitions(sqlite3 PRIVATE
- $<$<CONFIG:Debug>:-DSQLITE_DEBUG>
+target_compile_definitions(sqlite3 PRIVATE
+ $<$<CONFIG:Debug>:SQLITE_DEBUG>
${API}
-DSQLITE_ENABLE_RTREE
-DSQLITE_ENABLE_UNLOCK_NOTIFY
)
target_include_directories(sqlite3 INTERFACE $<INSTALL_INTERFACE:include>)
-if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore")
+if(CMAKE_SYSTEM_NAME MATCHES "WindowsStore")
target_compile_definitions(sqlite3 PRIVATE -DSQLITE_OS_WINRT=1)
endif()
-install(TARGETS sqlite3 EXPORT sqlite3Config
+if(NOT SQLITE3_SKIP_TOOLS)
+ add_executable(sqlite3-bin shell.c)
+ set_target_properties(sqlite3-bin PROPERTIES OUTPUT_NAME sqlite3)
+ target_link_libraries(sqlite3-bin PRIVATE sqlite3)
+ install(TARGETS sqlite3-bin sqlite3
+ RUNTIME DESTINATION tools
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+ )
+endif()
+
+install(TARGETS sqlite3 EXPORT sqlite3Config
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
-install(FILES ${SOURCE}/sqlite3.h ${SOURCE}/sqlite3ext.h DESTINATION include CONFIGURATIONS Release)
-install(EXPORT sqlite3Config DESTINATION share/sqlite3) \ No newline at end of file
+
+install(FILES sqlite3.h sqlite3ext.h DESTINATION include CONFIGURATIONS Release)
+install(EXPORT sqlite3Config DESTINATION share/sqlite3)
diff --git a/ports/sqlite3/CONTROL b/ports/sqlite3/CONTROL
index f1d9bde16..74d70909b 100644
--- a/ports/sqlite3/CONTROL
+++ b/ports/sqlite3/CONTROL
@@ -1,3 +1,6 @@
-Source: sqlite3
-Version: 3.18.0-1
-Description: SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. \ No newline at end of file
+Source: sqlite3
+Version: 3.23.1-1
+Description: SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.
+
+Feature: tool
+Description: sqlite3 executable
diff --git a/ports/sqlite3/portfile.cmake b/ports/sqlite3/portfile.cmake
index 1b906fba5..bd7bcc15c 100644
--- a/ports/sqlite3/portfile.cmake
+++ b/ports/sqlite3/portfile.cmake
@@ -1,30 +1,38 @@
include(vcpkg_common_functions)
-set(SQLITE_VERSION 3180000)
-set(SQLITE_HASH d390c1d83afc27ec184ea6ab392477647cc80eb97ca177797cd494409c5646435c7a84502cc74ded1b654af13e65d2eef444bb0255a127e59d2cf40d5d0c1192)
+set(SQLITE_VERSION 3230100)
+set(SQLITE_HASH 5784f4dea7f14d7dcf5dd07f0e111c8f0b64ff55c68b32a23fba7a36baf1f095c7a35573fc3b57b84822878218b78f9b0187c4e3f0439d4215471ee5f556eee1)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/sqlite-amalgamation-${SQLITE_VERSION})
vcpkg_download_distfile(ARCHIVE
- URLS "https://sqlite.org/2017/sqlite-amalgamation-${SQLITE_VERSION}.zip"
+ URLS "https://sqlite.org/2018/sqlite-amalgamation-${SQLITE_VERSION}.zip"
FILENAME "sqlite-amalgamation-${SQLITE_VERSION}.zip"
SHA512 ${SQLITE_HASH})
vcpkg_extract_source_archive(${ARCHIVE})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+set(SQLITE3_SKIP_TOOLS ON)
+if("tool" IN_LIST FEATURES)
+ set(SQLITE3_SKIP_TOOLS OFF)
+endif()
+
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
- -DSOURCE=${SOURCE_PATH}
- -DVCPKG_CMAKE_SYSTEM_NAME=${VCPKG_CMAKE_SYSTEM_NAME}
+ -DSQLITE3_SKIP_TOOLS=${SQLITE3_SKIP_TOOLS}
+ OPTIONS_DEBUG
+ -DSQLITE3_SKIP_TOOLS=ON
)
-vcpkg_build_cmake()
+
vcpkg_install_cmake()
-file(READ ${CURRENT_PACKAGES_DIR}/debug/share/sqlite3/sqlite3Config-debug.cmake SQLITE3_DEBUG_CONFIG)
-string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" SQLITE3_DEBUG_CONFIG "${SQLITE3_DEBUG_CONFIG}")
-file(WRITE ${CURRENT_PACKAGES_DIR}/share/sqlite3/sqlite3Config-debug.cmake "${SQLITE3_DEBUG_CONFIG}")
+if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+ file(READ ${CURRENT_PACKAGES_DIR}/debug/share/sqlite3/sqlite3Config-debug.cmake SQLITE3_DEBUG_CONFIG)
+ string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" SQLITE3_DEBUG_CONFIG "${SQLITE3_DEBUG_CONFIG}")
+ file(WRITE ${CURRENT_PACKAGES_DIR}/share/sqlite3/sqlite3Config-debug.cmake "${SQLITE3_DEBUG_CONFIG}")
+endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)