diff options
| author | Park DongHa <luncliff@gmail.com> | 2021-02-03 08:00:00 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-02 15:00:00 -0800 |
| commit | 3b4a4e4b5cff58ae9af6b46ad63fda71146f6ce4 (patch) | |
| tree | da5899a12cda3b59457e4dd49290bf5d352f6bb6 /ports | |
| parent | 4ef16cd07edc4cc9570d543a4eb09c51006588ab (diff) | |
| download | vcpkg-3b4a4e4b5cff58ae9af6b46ad63fda71146f6ce4.tar.gz vcpkg-3b4a4e4b5cff58ae9af6b46ad63fda71146f6ce4.zip | |
[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
Diffstat (limited to 'ports')
| -rw-r--r-- | ports/metrohash/CMakeLists.txt | 16 | ||||
| -rw-r--r-- | ports/metrohash/CONTROL | 5 | ||||
| -rw-r--r-- | ports/metrohash/portfile.cmake | 10 | ||||
| -rw-r--r-- | ports/metrohash/vcpkg.json | 8 |
4 files changed, 28 insertions, 11 deletions
diff --git a/ports/metrohash/CMakeLists.txt b/ports/metrohash/CMakeLists.txt index 41e1a74b3..1c5081203 100644 --- a/ports/metrohash/CMakeLists.txt +++ b/ports/metrohash/CMakeLists.txt @@ -5,10 +5,20 @@ set(CMAKE_CXX_STANDARD 17) add_library(metrohash src/metrohash64.cpp src/metrohash128.cpp - src/metrohash128crc.cpp ) -target_compile_options(metrohash PRIVATE -march=native) -set(metro_headers src/metrohash.h src/metrohash64.h src/metrohash128.h src/metrohash128crc.h) +list(APPEND metro_headers src/metrohash.h src/metrohash64.h src/metrohash128.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 PUBLIC_HEADER "${metro_headers}" ) diff --git a/ports/metrohash/CONTROL b/ports/metrohash/CONTROL deleted file mode 100644 index 85a795a3c..000000000 --- a/ports/metrohash/CONTROL +++ /dev/null @@ -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) diff --git a/ports/metrohash/portfile.cmake b/ports/metrohash/portfile.cmake index 1c272c818..66f7c957f 100644 --- a/ports/metrohash/portfile.cmake +++ b/ports/metrohash/portfile.cmake @@ -4,11 +4,15 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO jandrewrogers/MetroHash - REF 690a521d9beb2e1050cc8f273fdabc13b31bf8f6 - SHA512 51ba58a43f7a60be823746082c1bdebf52a1fd452a0f778434850ccc71dd6f62750fc966ec6aed6b4b523279ad400733df3f56544e2d2e057c212044a2dc16a4 + REF v1.1.3 + SHA512 02b6316e5ebf3d81465eea8a068565452be642394ddf5a53350affbbc9b9bfe1c3d182f7e8f7d49895351c48e11929e465777535e4354e01b6d0ba459e583ac5 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}/Config.cmake.in ${SOURCE_PATH}/cmake/Config.cmake.in COPYONLY) diff --git a/ports/metrohash/vcpkg.json b/ports/metrohash/vcpkg.json new file mode 100644 index 000000000..bfb1e6722 --- /dev/null +++ b/ports/metrohash/vcpkg.json @@ -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)" +} |
