[xxhash] Add xxhsum as feature (#14227)

This commit is contained in:
NancyLi1013 2020-10-27 15:58:18 +08:00 committed by GitHub
parent dcbbc5ed0e
commit 44842bfd6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View File

@ -1,4 +1,8 @@
Source: xxhash
Version: 0.8.0
Port-Version: 1
Homepage: https://github.com/Cyan4973/xxHash
Description: Extremely fast hash algorithm
Feature: xxhsum
Description: Build the xxhsum binary

View File

@ -1,5 +1,3 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Cyan4973/xxHash
@ -8,17 +6,25 @@ vcpkg_from_github(
HEAD_REF dev
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
xxhsum XXHASH_BUILD_XXHSUM
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}/cmake_unofficial
PREFER_NINJA
OPTIONS ${FEATURE_OPTIONS}
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/xxHash TARGET_PATH share/${PORT})
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
if("xxhsum" IN_LIST FEATURES)
vcpkg_copy_tools(TOOL_NAMES xxhsum AUTO_CLEAN)
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)