[lmdb] Remove non-WIN32 dependencies on ntdll.lib. Fixed #4053 (#4054)

* Remove non-WIN32 dependencies on ntdll.lib. Fixed #4053

* [lmdb] Use vcpkg_from_github

* [lmdb] Fix broken SOURCE_PATH
This commit is contained in:
icedream2linxi 2018-08-25 05:03:45 +08:00 committed by Robert Schumacher
parent cef892ffae
commit 5fd80fa194
3 changed files with 15 additions and 20 deletions

View File

@ -1,3 +1,3 @@
Source: lmdb
Version: 0.9.18-3
Version: 0.9.18-4
Description: LMDB is an extraordinarily fast, memory-efficient database

View File

@ -29,7 +29,9 @@ endif()
set(SRCS lmdb mdb.c lmdb.h midl.c midl.h )
add_library(lmdb ${SRCS})
set_target_properties(lmdb PROPERTIES DEBUG_POSTFIX d)
target_link_libraries(lmdb PRIVATE ntdll.lib)
if (WIN32)
target_link_libraries(lmdb PRIVATE ntdll.lib)
endif()
install(TARGETS lmdb DESTINATION lib
EXPORT lmdb-targets

View File

@ -1,33 +1,26 @@
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/lmdb-LMDB_0.9.18/libraries/liblmdb)
vcpkg_download_distfile(ARCHIVE_FILE
URLS "https://github.com/LMDB/lmdb/archive/LMDB_0.9.18.zip"
FILENAME "LMDB_0.9.18.zip"
SHA512 46d7ba226af05443c871f83c6ae0ab2ddbeecd289df59c082e806e135fcaa69d9d9060a19a4a907c4f7046de30871126e91e540eca27fc94446e95ba5616155b
)
vcpkg_extract_source_archive(${ARCHIVE_FILE})
vcpkg_apply_patches(
SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/lmdb-LMDB_0.9.18
PATCHES ${CMAKE_CURRENT_LIST_DIR}/lmdb_45a88275d2a410e683bae4ef44881e0f55fa3c4d.patch
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO LMDB/lmdb
REF LMDB_0.9.18
SHA512 394e88d99d446eb30771d7cf7a661584683a0d6d8e976cc561b5eecbb2a5d0817bbd59994002afa4eae6c86a39f05f50ebc2eff77cd70dd8c67225df4611f5e6
HEAD_REF master
PATCHES lmdb_45a88275d2a410e683bae4ef44881e0f55fa3c4d.patch
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/cmake/ DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/cmake/ DESTINATION ${SOURCE_PATH}/libraries/liblmdb)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
SOURCE_PATH ${SOURCE_PATH}/libraries/liblmdb
OPTIONS_DEBUG
-DLMDB_INSTALL_HEADERS=OFF
)
vcpkg_install_cmake()
file(READ ${CURRENT_PACKAGES_DIR}/debug/share/lmdb/lmdb-targets-debug.cmake LMDB_DEBUG_MODULE)
string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" LMDB_DEBUG_MODULE "${LMDB_DEBUG_MODULE}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/lmdb/lmdb-targets-debug.cmake "${LMDB_DEBUG_MODULE}")
vcpkg_fixup_cmake_targets(CONFIG_PATH share/lmdb)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/lmdb RENAME copyright)
file(INSTALL ${SOURCE_PATH}/libraries/liblmdb/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/lmdb RENAME copyright)
vcpkg_copy_pdbs()