mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 13:07:50 +08:00
80c87b97b3
<!-- If your PR fixes issues, please note that here by adding "Fixes #NNNNNN." for each fixed issue on separate lines. --> <!-- If you are still working on the PR, open it as a Draft: https://github.blog/2019-02-14-introducing-draft-pull-requests/. --> - [x] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md). - [x] SHA512s are updated for each updated download. - [x] The "supports" clause reflects platforms that may be fixed by this new version. - [x] Any fixed [CI baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt) entries are removed from that file. - [x] Any patches that are no longer applied are deleted from the port's directory. - [x] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result. - [x] Only one version is added to each modified port's versions file. <!-- If this PR adds a new port, please uncomment and fill out this checklist: - [ ] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md). - [ ] The name of the port matches an existing name for this component on https://repology.org/ if possible, and/or is strongly associated with that component on search engines. - [ ] Optional dependencies are resolved in exactly one way. For example, if the component is built with CMake, all `find_package` calls are REQUIRED, are satisfied by `vcpkg.json`'s declared dependencies, or disabled with [CMAKE_DISABLE_FIND_PACKAGE_Xxx](https://cmake.org/cmake/help/latest/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.html). - [ ] The versioning scheme in `vcpkg.json` matches what upstream says. - [ ] The license declaration in `vcpkg.json` matches what upstream says. - [ ] The installed as the "copyright" file matches what upstream says. - [ ] The source code of the component installed comes from an authoritative source. - [ ] The generated "usage text" is accurate. See [adding-usage](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/examples/adding-usage.md) for context. - [ ] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result. - [ ] Only one version is in the new port's versions file. - [ ] Only one version is added to each modified port's versions file. END OF NEW PORT CHECKLIST (delete this line) -->
100 lines
3.5 KiB
CMake
100 lines
3.5 KiB
CMake
string(REGEX REPLACE "^([0-9]+)[.]([0-9]+)[.]([0-9]+)[.]([0-9]+)" "\\1,0\\2,0\\3,0\\4," SQLITE_VERSION "${VERSION}.0")
|
|
string(REGEX REPLACE "^([0-9]+),0*([0-9][0-9]),0*([0-9][0-9]),0*([0-9][0-9])," "\\1\\2\\3\\4" SQLITE_VERSION "${SQLITE_VERSION}")
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
|
URLS "https://sqlite.org/2024/sqlite-autoconf-${SQLITE_VERSION}.tar.gz"
|
|
FILENAME "sqlite-autoconf-${SQLITE_VERSION}.zip"
|
|
SHA512 ab4bb99186ccf81d288bc5150dacd5f8a32561303fbc0c607c24b5bb5ad44e0974655cea57d05122c62e957329f5260d170d2a71cbcf818501af29903c99a391
|
|
)
|
|
|
|
vcpkg_extract_source_archive(
|
|
SOURCE_PATH
|
|
ARCHIVE "${ARCHIVE}"
|
|
PATCHES
|
|
fix-arm-uwp.patch
|
|
add-config-include.patch
|
|
)
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
set(SQLITE_API "__declspec(dllimport)")
|
|
else()
|
|
set(SQLITE_API "__attribute__((visibility(\"default\")))")
|
|
endif()
|
|
else()
|
|
set(SQLITE_API "")
|
|
endif()
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
FEATURES
|
|
fts5 SQLITE_ENABLE_FTS5
|
|
math SQLITE_ENABLE_MATH_FUNCTIONS
|
|
zlib WITH_ZLIB
|
|
INVERTED_FEATURES
|
|
tool SQLITE3_SKIP_TOOLS
|
|
)
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS none # only using the script-mode side-effects
|
|
FEATURES
|
|
dbstat SQLITE_ENABLE_DBSTAT_VTAB
|
|
fts3 SQLITE_ENABLE_FTS3
|
|
fts4 SQLITE_ENABLE_FTS4
|
|
memsys3 SQLITE_ENABLE_MEMSYS3
|
|
memsys5 SQLITE_ENABLE_MEMSYS5
|
|
limit SQLITE_ENABLE_UPDATE_DELETE_LIMIT
|
|
rtree SQLITE_ENABLE_RTREE
|
|
session SQLITE_ENABLE_SESSION
|
|
session SQLITE_ENABLE_PREUPDATE_HOOK
|
|
snapshot SQLITE_ENABLE_SNAPSHOT
|
|
omit-load-extension SQLITE_OMIT_LOAD_EXTENSION
|
|
geopoly SQLITE_ENABLE_GEOPOLY
|
|
soundex SQLITE_SOUNDEX
|
|
INVERTED_FEATURES
|
|
json1 SQLITE_OMIT_JSON
|
|
)
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
set(SQLITE_OS_WIN "1")
|
|
if(VCPKG_TARGET_IS_UWP)
|
|
set(SQLITE_OS_WINRT "1")
|
|
endif()
|
|
else()
|
|
set(SQLITE_OS_UNIX "1")
|
|
endif()
|
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/sqlite3.pc.in" DESTINATION "${SOURCE_PATH}")
|
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/sqlite3-vcpkg-config.h.in" "${SOURCE_PATH}/sqlite3-vcpkg-config.h" @ONLY)
|
|
|
|
vcpkg_cmake_configure(
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
OPTIONS
|
|
${FEATURE_OPTIONS}
|
|
-DPKGCONFIG_VERSION=${VERSION}
|
|
OPTIONS_DEBUG
|
|
-DSQLITE3_SKIP_TOOLS=ON
|
|
MAYBE_UNUSED_VARIABLES
|
|
SQLITE_ENABLE_FTS5
|
|
SQLITE_ENABLE_MATH_FUNCTIONS
|
|
)
|
|
|
|
vcpkg_cmake_install()
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT} CONFIG_PATH share/unofficial-${PORT})
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
|
|
|
if("tool" IN_LIST FEATURES)
|
|
vcpkg_copy_tools(TOOL_NAMES sqlite3 DESTINATION "${CURRENT_PACKAGES_DIR}/tools" AUTO_CLEAN)
|
|
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()
|
|
vcpkg_copy_pdbs()
|
|
|
|
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n")
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|