2021-09-23 04:00:06 +08:00
|
|
|
# Be sure to update both of these versions together.
|
2022-11-19 05:06:32 +08:00
|
|
|
set(SQLITE_VERSION 3400000)
|
|
|
|
set(PKGCONFIG_VERSION 3.40.0)
|
|
|
|
set(SQLITE_HASH db099793e05ac0f37355c9bd41173fb63cfe20fe4eea49de227d06f6d22064ded38bb8369c495ce06a1ef1e687d41169d93d74359367333622c6893720f3c1f0)
|
2017-04-02 04:35:22 +08:00
|
|
|
|
2017-02-15 20:14:37 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2022-07-21 06:40:29 +08:00
|
|
|
URLS "https://sqlite.org/2022/sqlite-amalgamation-${SQLITE_VERSION}.zip"
|
2017-04-02 04:35:22 +08:00
|
|
|
FILENAME "sqlite-amalgamation-${SQLITE_VERSION}.zip"
|
2018-11-07 09:29:12 +08:00
|
|
|
SHA512 ${SQLITE_HASH}
|
|
|
|
)
|
|
|
|
|
2022-11-19 05:06:32 +08:00
|
|
|
vcpkg_extract_source_archive(
|
|
|
|
SOURCE_PATH
|
|
|
|
ARCHIVE "${ARCHIVE}"
|
2019-07-16 01:41:11 +08:00
|
|
|
PATCHES fix-arm-uwp.patch
|
2018-11-07 09:29:12 +08:00
|
|
|
)
|
2017-02-15 20:14:37 +08:00
|
|
|
|
2021-09-10 12:06:12 +08:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
2021-09-23 04:00:06 +08:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/sqlite3.pc.in" DESTINATION "${SOURCE_PATH}")
|
2017-02-15 20:14:37 +08:00
|
|
|
|
2020-01-10 06:36:56 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2020-08-15 01:29:18 +08:00
|
|
|
FEATURES
|
2022-02-17 05:00:36 +08:00
|
|
|
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
|
2021-09-10 12:06:12 +08:00
|
|
|
INVERTED_FEATURES
|
2022-02-17 05:00:36 +08:00
|
|
|
tool SQLITE3_SKIP_TOOLS
|
2020-01-10 06:36:56 +08:00
|
|
|
)
|
2018-02-28 04:24:41 +08:00
|
|
|
|
2021-09-10 12:06:12 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2021-09-23 04:00:06 +08:00
|
|
|
OPTIONS
|
|
|
|
${FEATURE_OPTIONS}
|
|
|
|
-DPKGCONFIG_VERSION=${PKGCONFIG_VERSION}
|
2018-02-28 04:24:41 +08:00
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DSQLITE3_SKIP_TOOLS=ON
|
2017-02-15 20:14:37 +08:00
|
|
|
)
|
2018-02-28 04:24:41 +08:00
|
|
|
|
2021-09-10 12:06:12 +08:00
|
|
|
vcpkg_cmake_install()
|
2022-02-17 05:00:36 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2021-09-10 12:06:12 +08:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT} CONFIG_PATH share/unofficial-${PORT})
|
2017-02-15 20:14:37 +08:00
|
|
|
|
2021-09-10 12:06:12 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2017-02-15 20:14:37 +08:00
|
|
|
|
2021-09-10 12:06:12 +08:00
|
|
|
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}")
|
2020-01-10 06:36:56 +08:00
|
|
|
endif()
|
|
|
|
|
2018-06-16 11:07:21 +08:00
|
|
|
configure_file(
|
2021-09-10 12:06:12 +08:00
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/sqlite3-config.in.cmake"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-sqlite3-config.cmake"
|
2018-06-16 11:07:21 +08:00
|
|
|
@ONLY
|
|
|
|
)
|
|
|
|
|
2021-09-23 04:00:06 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
2021-05-29 01:56:31 +08:00
|
|
|
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()
|
|
|
|
|
2022-08-13 06:45:09 +08:00
|
|
|
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n")
|