diff options
| author | kreuzerkrieg <kreuzerkrieg@gmail.com> | 2020-03-11 00:40:15 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-10 15:40:15 -0700 |
| commit | fb87bc7d4152f16babb7717bfb51334acdba1f27 (patch) | |
| tree | 8d47b84bd3f3d45e909e0ab200f370577a6afd7c | |
| parent | 51974b9a5df38c68d50323614be01c4b4b48d857 (diff) | |
| download | vcpkg-fb87bc7d4152f16babb7717bfb51334acdba1f27.tar.gz vcpkg-fb87bc7d4152f16babb7717bfb51334acdba1f27.zip | |
[MetroHash] Add new port (#10049)
* MetroHash
* wip
* wip
* wip
| -rw-r--r-- | ports/metrohash/CMakeLists.txt | 44 | ||||
| -rw-r--r-- | ports/metrohash/CONTROL | 5 | ||||
| -rw-r--r-- | ports/metrohash/Config.cmake.in | 4 | ||||
| -rw-r--r-- | ports/metrohash/portfile.cmake | 25 | ||||
| -rw-r--r-- | scripts/ci.baseline.txt | 4 |
5 files changed, 82 insertions, 0 deletions
diff --git a/ports/metrohash/CMakeLists.txt b/ports/metrohash/CMakeLists.txt new file mode 100644 index 000000000..04a667c5c --- /dev/null +++ b/ports/metrohash/CMakeLists.txt @@ -0,0 +1,44 @@ +cmake_minimum_required(VERSION 3.14) +project(MetroHash LANGUAGES CXX) +set(CMAKE_CXX_STANDARD 17) + +add_library(metrohash + src/metrohash64.cpp + src/metrohash128.cpp + src/metrohash128crc.cpp + ) +target_compile_options(metrohash PRIVATE -march=native) +target_include_directories(metrohash SYSTEM PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/src/) +set (metro_headers src/metrohash64.h src/metrohash128.h src/metrohash128crc.h) +set_target_properties(metrohash PROPERTIES + PUBLIC_HEADER "${metro_headers}" + ) + +include(CMakePackageConfigHelpers) + +set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated") +set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake") +set(config_install_dir "lib/cmake/${PROJECT_NAME}") +set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets") +set(namespace "${PROJECT_NAME}::") + +# Configure '<PROJECT-NAME>Config.cmake' +# Use variables: +# * TARGETS_EXPORT_NAME +# * PROJECT_NAME +configure_package_config_file( + "${CMAKE_SOURCE_DIR}/cmake/Config.cmake.in" + "${project_config}" + INSTALL_DESTINATION "${config_install_dir}" +) +#Installation +install(TARGETS metrohash + EXPORT "${TARGETS_EXPORT_NAME}" + LIBRARY DESTINATION "lib" + ARCHIVE DESTINATION "lib" + INCLUDES DESTINATION "include") + +install(EXPORT "${TARGETS_EXPORT_NAME}" + NAMESPACE "${namespace}" + DESTINATION "${config_install_dir}" + ) diff --git a/ports/metrohash/CONTROL b/ports/metrohash/CONTROL new file mode 100644 index 000000000..276c530e0 --- /dev/null +++ b/ports/metrohash/CONTROL @@ -0,0 +1,5 @@ +Source: metrohash +Version: 1.1.3 +Homepage: https://github.com/jandrewrogers/MetroHash +Description: MetroHash is a set of state-of-the-art hash functions for non-cryptographic use cases. +Supports: !(uwp|arm|x86) diff --git a/ports/metrohash/Config.cmake.in b/ports/metrohash/Config.cmake.in new file mode 100644 index 000000000..38bbde7b3 --- /dev/null +++ b/ports/metrohash/Config.cmake.in @@ -0,0 +1,4 @@ +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake") +check_required_components("@PROJECT_NAME@") diff --git a/ports/metrohash/portfile.cmake b/ports/metrohash/portfile.cmake new file mode 100644 index 000000000..ad26b8b6d --- /dev/null +++ b/ports/metrohash/portfile.cmake @@ -0,0 +1,25 @@ +vcpkg_fail_port_install(ON_TARGET "UWP" ON_TARGET "x86" "arm" "aarch64") +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO jandrewrogers/MetroHash + REF 690a521d9beb2e1050cc8f273fdabc13b31bf8f6 + SHA512 51ba58a43f7a60be823746082c1bdebf52a1fd452a0f778434850ccc71dd6f62750fc966ec6aed6b4b523279ad400733df3f56544e2d2e057c212044a2dc16a4 + HEAD_REF master +) + +configure_file(${CURRENT_PORT_DIR}/CMakeLists.txt ${SOURCE_PATH}/CMakeLists.txt COPYONLY) +configure_file(${CURRENT_PORT_DIR}/Config.cmake.in ${SOURCE_PATH}/cmake/Config.cmake.in COPYONLY) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 035d0ac22..de59916c1 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1061,6 +1061,10 @@ meschach:x64-osx=fail meschach:x64-uwp=fail
metis:arm-uwp=fail
metis:x64-uwp=fail
+metrohash:arm-uwp=fail
+metrohash:x64-uwp=fail
+metrohash:x86-windows=fail
+metrohash:arm64-windows=fail
mhook:arm64-windows=fail
mhook:arm-uwp=fail
mhook:x64-linux=fail
|
