early-access version 2853
This commit is contained in:
171
externals/vcpkg/ports/sqlite3/CMakeLists.txt
vendored
Executable file
171
externals/vcpkg/ports/sqlite3/CMakeLists.txt
vendored
Executable file
@@ -0,0 +1,171 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
project(sqlite3 C)
|
||||
|
||||
option(ENABLE_FTS3 "Enable the FTS3 extension" OFF)
|
||||
option(ENABLE_FTS4 "Enable the FTS4 extension" OFF)
|
||||
option(ENABLE_FTS5 "Enable the FTS5 extension" OFF)
|
||||
option(ENABLE_MEMSYS3 "Enable MEMSYS3" OFF)
|
||||
option(ENABLE_MEMSYS5 "Enable MEMSYS5" OFF)
|
||||
option(ENABLE_MATH_FUNCTION "Enable math functions" OFF)
|
||||
option(ENABLE_LIMIT "Enable the UPDATE/DELETE LIMIT clause" OFF)
|
||||
option(ENABLE_RTREE "Enable the RTREE extension" OFF)
|
||||
option(ENABLE_SESSION "Enable the SESSION extension" OFF)
|
||||
option(ENABLE_OMIT_LOAD_EXT "Enable loading of external extensions" OFF)
|
||||
option(WITH_GEOPOLY "Enable geopoly functionality for sqlite3" OFF)
|
||||
option(WITH_JSON1 "Enable JSON functionality for sqlite3" OFF)
|
||||
option(WITH_ZLIB "Build sqlite3 with zlib support" OFF)
|
||||
option(SQLITE3_SKIP_TOOLS "Disable build sqlite3 executable" OFF)
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
if(UNIX)
|
||||
set(SQLITE_API "-DSQLITE_API=__attribute__((visibility(\"default\")))")
|
||||
elseif(WIN32)
|
||||
set(SQLITE_API "-DSQLITE_API=__declspec(dllexport)")
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported platform: ${CMAKE_SYSTEM_NAME}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_library(sqlite3 sqlite3.c)
|
||||
|
||||
target_include_directories(sqlite3 PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}> $<INSTALL_INTERFACE:include>)
|
||||
|
||||
target_compile_definitions(
|
||||
sqlite3
|
||||
PRIVATE
|
||||
$<$<CONFIG:Debug>:SQLITE_DEBUG=1>
|
||||
$<$<CONFIG:Debug>:SQLITE_ENABLE_SELECTTRACE>
|
||||
$<$<CONFIG:Debug>:SQLITE_ENABLE_WHERETRACE>
|
||||
${SQLITE_API}
|
||||
-DSQLITE_ENABLE_UNLOCK_NOTIFY
|
||||
-DSQLITE_ENABLE_COLUMN_METADATA
|
||||
)
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
if (UNIX)
|
||||
string(APPEND PKGCONFIG_DEFINES " -DSQLITE_API=__attribute__((visibility(\"default\")))")
|
||||
target_compile_definitions(sqlite3 INTERFACE "SQLITE_API=__attribute__((visibility(\"default\")))")
|
||||
elseif (WIN32)
|
||||
string(APPEND PKGCONFIG_DEFINES " -DSQLITE_API=__declspec(dllimport)")
|
||||
target_compile_definitions(sqlite3 INTERFACE "SQLITE_API=__declspec(dllimport)")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (ENABLE_FTS3)
|
||||
string(APPEND PKGCONFIG_DEFINES " -DSQLITE_ENABLE_FTS3")
|
||||
target_compile_definitions(sqlite3 PUBLIC SQLITE_ENABLE_FTS3)
|
||||
endif()
|
||||
|
||||
if (ENABLE_FTS4)
|
||||
string(APPEND PKGCONFIG_DEFINES " -DSQLITE_ENABLE_FTS4")
|
||||
target_compile_definitions(sqlite3 PUBLIC SQLITE_ENABLE_FTS4)
|
||||
endif()
|
||||
|
||||
if (ENABLE_FTS5)
|
||||
string(APPEND PKGCONFIG_DEFINES " -DSQLITE_ENABLE_FTS5")
|
||||
target_compile_definitions(sqlite3 PUBLIC SQLITE_ENABLE_FTS5)
|
||||
endif()
|
||||
|
||||
if (ENABLE_MEMSYS3)
|
||||
string(APPEND PKGCONFIG_DEFINES " -DSQLITE_ENABLE_MEMSYS3")
|
||||
target_compile_definitions(sqlite3 PUBLIC SQLITE_ENABLE_MEMSYS3)
|
||||
endif()
|
||||
|
||||
if (ENABLE_MEMSYS5)
|
||||
string(APPEND PKGCONFIG_DEFINES " -DSQLITE_ENABLE_MEMSYS5")
|
||||
target_compile_definitions(sqlite3 PUBLIC SQLITE_ENABLE_MEMSYS5)
|
||||
endif()
|
||||
|
||||
if (ENABLE_MATH_FUNCTION)
|
||||
string(APPEND PKGCONFIG_DEFINES " -DSQLITE_ENABLE_MATH_FUNCTIONS")
|
||||
target_compile_definitions(sqlite3 PUBLIC SQLITE_ENABLE_MATH_FUNCTIONS)
|
||||
endif()
|
||||
|
||||
if (ENABLE_LIMIT)
|
||||
string(APPEND PKGCONFIG_DEFINES " -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT")
|
||||
target_compile_definitions(sqlite3 PUBLIC SQLITE_ENABLE_UPDATE_DELETE_LIMIT)
|
||||
endif()
|
||||
|
||||
if (ENABLE_RTREE)
|
||||
string(APPEND PKGCONFIG_DEFINES " -DSQLITE_ENABLE_RTREE")
|
||||
target_compile_definitions(sqlite3 PUBLIC SQLITE_ENABLE_RTREE)
|
||||
endif()
|
||||
|
||||
if (ENABLE_SESSION)
|
||||
string(APPEND PKGCONFIG_DEFINES " -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK")
|
||||
target_compile_definitions(sqlite3 PUBLIC SQLITE_ENABLE_SESSION SQLITE_ENABLE_PREUPDATE_HOOK)
|
||||
endif()
|
||||
|
||||
if (ENABLE_OMIT_LOAD_EXT)
|
||||
string(APPEND PKGCONFIG_DEFINES " -DSQLITE_OMIT_LOAD_EXTENSION")
|
||||
target_compile_definitions(sqlite3 PUBLIC SQLITE_OMIT_LOAD_EXTENSION)
|
||||
endif()
|
||||
|
||||
if(WITH_GEOPOLY)
|
||||
string(APPEND PKGCONFIG_DEFINES " -DSQLITE_ENABLE_GEOPOLY")
|
||||
target_compile_definitions(sqlite3 PUBLIC SQLITE_ENABLE_GEOPOLY)
|
||||
endif()
|
||||
|
||||
if(WITH_JSON1)
|
||||
string(APPEND PKGCONFIG_DEFINES " -DSQLITE_ENABLE_JSON1")
|
||||
target_compile_definitions(sqlite3 PUBLIC SQLITE_ENABLE_JSON1)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
string(APPEND PKGCONFIG_DEFINES " -DQLITE_OS_WIN=1")
|
||||
target_compile_definitions(sqlite3 PUBLIC -DSQLITE_OS_WIN=1)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "WindowsStore")
|
||||
string(APPEND PKGCONFIG_DEFINES " -DSQLITE_OS_WINRT=1")
|
||||
target_compile_definitions(sqlite3 PUBLIC -DSQLITE_OS_WINRT=1)
|
||||
endif()
|
||||
else()
|
||||
string(APPEND PKGCONFIG_DEFINES " -DSQLITE_OS_UNIX=1")
|
||||
target_compile_definitions(sqlite3 PUBLIC -DSQLITE_OS_UNIX=1)
|
||||
endif()
|
||||
|
||||
if(NOT WIN32)
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(sqlite3 PUBLIC Threads::Threads ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
|
||||
if (WITH_ZLIB)
|
||||
find_package(ZLIB REQUIRED)
|
||||
target_link_libraries(sqlite3 PUBLIC ZLIB::ZLIB)
|
||||
endif()
|
||||
|
||||
if(NOT SQLITE3_SKIP_TOOLS)
|
||||
add_executable(sqlite3-bin shell.c)
|
||||
|
||||
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 unofficial-sqlite3-targets
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
|
||||
install(FILES sqlite3.h sqlite3ext.h DESTINATION include CONFIGURATIONS Release)
|
||||
install(EXPORT unofficial-sqlite3-targets NAMESPACE unofficial::sqlite3:: FILE unofficial-sqlite3-targets.cmake DESTINATION share/unofficial-sqlite3)
|
||||
|
||||
if(UNIX)
|
||||
set(PKGCONFIG_LIBS_PRIVATE "-lm -ldl")
|
||||
if(NOT ANDROID)
|
||||
string(APPEND PKGCONFIG_LIBS_PRIVATE " -lpthread")
|
||||
endif()
|
||||
else()
|
||||
set(PKGCONFIG_LIBS_PRIVATE "")
|
||||
endif()
|
||||
|
||||
configure_file(sqlite3.pc.in sqlite3.pc @ONLY)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sqlite3.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
|
33
externals/vcpkg/ports/sqlite3/fix-arm-uwp.patch
vendored
Executable file
33
externals/vcpkg/ports/sqlite3/fix-arm-uwp.patch
vendored
Executable file
@@ -0,0 +1,33 @@
|
||||
diff --git a/shell.c b/shell.c
|
||||
index 10d8cc1..99f37a5 100644
|
||||
--- a/shell.c
|
||||
+++ b/shell.c
|
||||
@@ -316,7 +316,11 @@ static int hasTimer(void){
|
||||
*/
|
||||
hProcess = GetCurrentProcess();
|
||||
if( hProcess ){
|
||||
+#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
|
||||
HINSTANCE hinstLib = LoadLibrary(TEXT("Kernel32.dll"));
|
||||
+#else
|
||||
+ HINSTANCE hinstLib = LoadPackagedLibrary(TEXT("Kernel32.dll"), 0);
|
||||
+#endif
|
||||
if( NULL != hinstLib ){
|
||||
getProcessTimesAddr =
|
||||
(GETPROCTIMES) GetProcAddress(hinstLib, "GetProcessTimes");
|
||||
@@ -2437,10 +2441,16 @@ static int writeFile(
|
||||
if( zUnicodeName==0 ){
|
||||
return 1;
|
||||
}
|
||||
+#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
|
||||
hFile = CreateFileW(
|
||||
zUnicodeName, FILE_WRITE_ATTRIBUTES, 0, NULL, OPEN_EXISTING,
|
||||
FILE_FLAG_BACKUP_SEMANTICS, NULL
|
||||
);
|
||||
+#else
|
||||
+ hFile = CreateFile2(
|
||||
+ zUnicodeName, FILE_WRITE_ATTRIBUTES, 0, OPEN_EXISTING, NULL
|
||||
+ );
|
||||
+#endif
|
||||
sqlite3_free(zUnicodeName);
|
||||
if( hFile!=INVALID_HANDLE_VALUE ){
|
||||
BOOL bResult = SetFileTime(hFile, NULL, &lastAccess, &lastWrite);
|
72
externals/vcpkg/ports/sqlite3/portfile.cmake
vendored
Executable file
72
externals/vcpkg/ports/sqlite3/portfile.cmake
vendored
Executable file
@@ -0,0 +1,72 @@
|
||||
# Be sure to update both of these versions together.
|
||||
set(SQLITE_VERSION 3370100)
|
||||
set(PKGCONFIG_VERSION 3.37.1)
|
||||
set(SQLITE_HASH b59343772dc4c6bb8e05fff6206eeb44861efa52c120c789ce6b733e974cf950657b6ab369aa405d75f45ed9cf1cb8128a76447bc63e9ce9822578d71581a7a3)
|
||||
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "https://sqlite.org/2021/sqlite-amalgamation-${SQLITE_VERSION}.zip"
|
||||
FILENAME "sqlite-amalgamation-${SQLITE_VERSION}.zip"
|
||||
SHA512 ${SQLITE_HASH}
|
||||
)
|
||||
|
||||
vcpkg_extract_source_archive_ex(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
ARCHIVE ${ARCHIVE}
|
||||
REF ${SQLITE_VERSION}
|
||||
PATCHES fix-arm-uwp.patch
|
||||
)
|
||||
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/sqlite3.pc.in" DESTINATION "${SOURCE_PATH}")
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
fts3 ENABLE_FTS3
|
||||
fts4 ENABLE_FTS4
|
||||
fts5 ENABLE_FTS5
|
||||
memsys3 ENABLE_MEMSYS3
|
||||
memsys5 ENABLE_MEMSYS5
|
||||
math ENABLE_MATH_FUNCTION
|
||||
limit ENABLE_LIMIT
|
||||
rtree ENABLE_RTREE
|
||||
session ENABLE_SESSION
|
||||
omit-load-extension ENABLE_OMIT_LOAD_EXT
|
||||
geopoly WITH_GEOPOLY
|
||||
json1 WITH_JSON1
|
||||
zlib WITH_ZLIB
|
||||
INVERTED_FEATURES
|
||||
tool SQLITE3_SKIP_TOOLS
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
${FEATURE_OPTIONS}
|
||||
-DPKGCONFIG_VERSION=${PKGCONFIG_VERSION}
|
||||
OPTIONS_DEBUG
|
||||
-DSQLITE3_SKIP_TOOLS=ON
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_copy_pdbs()
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT} CONFIG_PATH share/unofficial-${PORT})
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
if(NOT SQLITE3_SKIP_TOOLS AND EXISTS "${CURRENT_PACKAGES_DIR}/tools/sqlite3-bin${VCPKG_HOST_EXECUTABLE_SUFFIX}")
|
||||
file(RENAME "${CURRENT_PACKAGES_DIR}/tools/sqlite3-bin${VCPKG_HOST_EXECUTABLE_SUFFIX}" "${CURRENT_PACKAGES_DIR}/tools/sqlite3${VCPKG_HOST_EXECUTABLE_SUFFIX}")
|
||||
endif()
|
||||
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_LIST_DIR}/sqlite3-config.in.cmake"
|
||||
"${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-sqlite3-config.cmake"
|
||||
@ONLY
|
||||
)
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/sqlite3.h" "# define SQLITE_API\n" "# define SQLITE_API __declspec(dllimport)\n")
|
||||
endif()
|
||||
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n")
|
7
externals/vcpkg/ports/sqlite3/sqlite3-config.in.cmake
vendored
Executable file
7
externals/vcpkg/ports/sqlite3/sqlite3-config.in.cmake
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
|
||||
if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static" AND NOT WIN32)
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(Threads)
|
||||
endif()
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/unofficial-sqlite3-targets.cmake)
|
11
externals/vcpkg/ports/sqlite3/sqlite3.pc.in
vendored
Executable file
11
externals/vcpkg/ports/sqlite3/sqlite3.pc.in
vendored
Executable file
@@ -0,0 +1,11 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
libdir=${prefix}/lib
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: SQLite
|
||||
Description: SQL database engine
|
||||
Version: @PKGCONFIG_VERSION@
|
||||
Libs: -L${libdir} -lsqlite3
|
||||
Libs.private: @PKGCONFIG_LIBS_PRIVATE@
|
||||
Cflags: -I${includedir} @PKGCONFIG_DEFINES@
|
65
externals/vcpkg/ports/sqlite3/vcpkg.json
vendored
Executable file
65
externals/vcpkg/ports/sqlite3/vcpkg.json
vendored
Executable file
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"name": "sqlite3",
|
||||
"version": "3.37.2",
|
||||
"port-version": 1,
|
||||
"description": "SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.",
|
||||
"homepage": "https://github.com/sqlite/sqlite",
|
||||
"license": "blessing",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"features": {
|
||||
"fts3": {
|
||||
"description": "Enable the FTS3 extension"
|
||||
},
|
||||
"fts4": {
|
||||
"description": "Enable the FTS4 extension"
|
||||
},
|
||||
"fts5": {
|
||||
"description": "Enable the FTS5 extension"
|
||||
},
|
||||
"geopoly": {
|
||||
"description": "Enable geopoly functionality for sqlite3"
|
||||
},
|
||||
"json1": {
|
||||
"description": "Enable JSON functionality for sqlite3"
|
||||
},
|
||||
"limit": {
|
||||
"description": "Enable the UPDATE/DELETE LIMIT clause"
|
||||
},
|
||||
"math": {
|
||||
"description": "Enable math functions"
|
||||
},
|
||||
"memsys3": {
|
||||
"description": "Enable MEMSYS3"
|
||||
},
|
||||
"memsys5": {
|
||||
"description": "Enable MEMSYS5"
|
||||
},
|
||||
"omit-load-extension": {
|
||||
"description": "Enable loading of external extensions"
|
||||
},
|
||||
"rtree": {
|
||||
"description": "Enable the RTREE extension"
|
||||
},
|
||||
"session": {
|
||||
"description": "Enable the SESSION extension"
|
||||
},
|
||||
"tool": {
|
||||
"description": "Build sqlite3 executable"
|
||||
},
|
||||
"zlib": {
|
||||
"description": "Build sqlite3 with zlib support",
|
||||
"dependencies": [
|
||||
"zlib"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user