mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 03:10:57 +08:00
[metrohash] support Android triplet build (#15715)
* [metrohash] support Android build * check ANDROID variable * exclude 'crc' sources that requires non-ARM intrinsic * rewrite CONTROL to vcpkg.json * [metrohash] update checksum and version JSON * [metrohash] apply PR feedback * [metrohash] enable sse4.2 for Clang compiler * [metrohash] fix wrong version string * [metrohash] fix wrong version string
This commit is contained in:
parent
4ef16cd07e
commit
3b4a4e4b5c
@ -5,10 +5,20 @@ set(CMAKE_CXX_STANDARD 17)
|
|||||||
add_library(metrohash
|
add_library(metrohash
|
||||||
src/metrohash64.cpp
|
src/metrohash64.cpp
|
||||||
src/metrohash128.cpp
|
src/metrohash128.cpp
|
||||||
src/metrohash128crc.cpp
|
|
||||||
)
|
)
|
||||||
target_compile_options(metrohash PRIVATE -march=native)
|
list(APPEND metro_headers src/metrohash.h src/metrohash64.h src/metrohash128.h)
|
||||||
set(metro_headers src/metrohash.h src/metrohash64.h src/metrohash128.h src/metrohash128crc.h)
|
|
||||||
|
if(NOT ANDROID)
|
||||||
|
list(APPEND metro_headers src/metrohash128crc.h)
|
||||||
|
target_sources(metrohash PRIVATE src/metrohash128crc.cpp)
|
||||||
|
if(CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
||||||
|
target_compile_options(metrohash PRIVATE -msse4.2)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
||||||
|
target_compile_options(metrohash PRIVATE -march=native)
|
||||||
|
endif()
|
||||||
|
|
||||||
set_target_properties(metrohash PROPERTIES
|
set_target_properties(metrohash PROPERTIES
|
||||||
PUBLIC_HEADER "${metro_headers}"
|
PUBLIC_HEADER "${metro_headers}"
|
||||||
)
|
)
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
Source: metrohash
|
|
||||||
Version: 1.1.3-1
|
|
||||||
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)
|
|
@ -4,11 +4,15 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|||||||
vcpkg_from_github(
|
vcpkg_from_github(
|
||||||
OUT_SOURCE_PATH SOURCE_PATH
|
OUT_SOURCE_PATH SOURCE_PATH
|
||||||
REPO jandrewrogers/MetroHash
|
REPO jandrewrogers/MetroHash
|
||||||
REF 690a521d9beb2e1050cc8f273fdabc13b31bf8f6
|
REF v1.1.3
|
||||||
SHA512 51ba58a43f7a60be823746082c1bdebf52a1fd452a0f778434850ccc71dd6f62750fc966ec6aed6b4b523279ad400733df3f56544e2d2e057c212044a2dc16a4
|
SHA512 02b6316e5ebf3d81465eea8a068565452be642394ddf5a53350affbbc9b9bfe1c3d182f7e8f7d49895351c48e11929e465777535e4354e01b6d0ba459e583ac5
|
||||||
HEAD_REF master
|
HEAD_REF master
|
||||||
)
|
)
|
||||||
|
if(VCPKG_TARGET_IS_ANDROID)
|
||||||
|
vcpkg_replace_string(${SOURCE_PATH}/src/metrohash.h
|
||||||
|
"#include \"metrohash128crc.h\""
|
||||||
|
"//#include \"metrohash128crc.h\" // It can't be supported for Android")
|
||||||
|
endif()
|
||||||
configure_file(${CURRENT_PORT_DIR}/CMakeLists.txt ${SOURCE_PATH}/CMakeLists.txt COPYONLY)
|
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)
|
configure_file(${CURRENT_PORT_DIR}/Config.cmake.in ${SOURCE_PATH}/cmake/Config.cmake.in COPYONLY)
|
||||||
|
|
||||||
|
8
ports/metrohash/vcpkg.json
Normal file
8
ports/metrohash/vcpkg.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"name": "metrohash",
|
||||||
|
"version-string": "1.1.3",
|
||||||
|
"port-version": 2,
|
||||||
|
"description": "MetroHash is a set of state-of-the-art hash functions for non-cryptographic use cases",
|
||||||
|
"homepage": "https://github.com/jandrewrogers/MetroHash",
|
||||||
|
"supports": "!(uwp | arm | x86)"
|
||||||
|
}
|
@ -3705,8 +3705,8 @@
|
|||||||
"port-version": 7
|
"port-version": 7
|
||||||
},
|
},
|
||||||
"metrohash": {
|
"metrohash": {
|
||||||
"baseline": "1.1.3-1",
|
"baseline": "1.1.3",
|
||||||
"port-version": 0
|
"port-version": 2
|
||||||
},
|
},
|
||||||
"mgnlibs": {
|
"mgnlibs": {
|
||||||
"baseline": "2019-09-29",
|
"baseline": "2019-09-29",
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"versions": [
|
"versions": [
|
||||||
|
{
|
||||||
|
"git-tree": "0c764c9b22fa64b5194e65f69bfb28bc47dc20fc",
|
||||||
|
"version-string": "1.1.3",
|
||||||
|
"port-version": 2
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"git-tree": "e322e34deeeb1ae533217d85ceea0b6ad36ec64e",
|
"git-tree": "e322e34deeeb1ae533217d85ceea0b6ad36ec64e",
|
||||||
"version-string": "1.1.3-1",
|
"version-string": "1.1.3-1",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user