[farmhash] support Windows build (#20506)

* [farmhash] support windows build

* [farmhash] update baseline JSON

* [farmhash] patch from PR diff

* [farmhash] patch from all PR changes

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
Park DongHa 2021-10-12 02:28:01 +09:00 committed by GitHub
parent d7cc563783
commit ad6bce211e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 33 additions and 22 deletions

View File

@ -13,4 +13,7 @@ get_filename_component(ROOT "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(ROOT "${ROOT}" PATH)
get_filename_component(ROOT "${ROOT}" PATH)
set_library_target("GOOGLE" "farmhash" "${ROOT}/debug/lib/libfarmhash.a" "${ROOT}/lib/libfarmhash.a" "${ROOT}/include/")
set_library_target("GOOGLE" "farmhash"
"${ROOT}/debug/lib/${CMAKE_STATIC_LIBRARY_PREFIX}farmhash${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${ROOT}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}farmhash${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${ROOT}/include/")

View File

@ -1,12 +1,19 @@
#Requires a compiler which understands '__builtin_unreachable':
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_download_distfile(WIN_PR_PATCH
URLS "https://github.com/google/farmhash/pull/40.diff"
FILENAME farmhash-pr-40.patch
SHA512 265f5c15c17da2b88c82e6016a181abe73d2d94492cdb0cba892acf67a9d40815d54fa81e07351254fe2a39aea143b125924db0e7df14aac84a7469a78612cbd
)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO google/farmhash
REF 0d859a811870d10f53a594927d0d0b97573ad06d
SHA512 7bc14931e488464c1cedbc17551fb90a8cec494d0e0860db9df8efff09000fd8d91e01060dd5c5149b1104ac4ac8bf7eb57e5b156b05ef42636938edad1518f1
HEAD_REF master
OUT_SOURCE_PATH SOURCE_PATH
REPO google/farmhash
REF 0d859a811870d10f53a594927d0d0b97573ad06d
SHA512 7bc14931e488464c1cedbc17551fb90a8cec494d0e0860db9df8efff09000fd8d91e01060dd5c5149b1104ac4ac8bf7eb57e5b156b05ef42636938edad1518f1
HEAD_REF master
PATCHES ${WIN_PR_PATCH}
)
if((VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) AND NOT ENV{CXX_FLAGS}) # This should be a compiler check
@ -14,14 +21,17 @@ if((VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) AND NOT ENV{CXX_FLAGS}) # This
endif()
file(REMOVE_RECURSE "${SOURCE_PATH}/configure")
vcpkg_configure_make(
AUTOCONFIG
SOURCE_PATH ${SOURCE_PATH}
AUTOCONFIG
SOURCE_PATH ${SOURCE_PATH}
)
vcpkg_install_make()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/farmhashConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/share" # eliminate unused files
)
file(INSTALL "${SOURCE_PATH}/COPYING"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/farmhashConfig.cmake"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

View File

@ -1,7 +1,7 @@
{
"name": "farmhash",
"version-string": "1.1",
"port-version": 3,
"port-version": 4,
"description": "FarmHash, a family of hash functions.",
"homepage": "https://github.com/google/farmhash",
"supports": "!arm"

View File

@ -279,13 +279,6 @@ epsilon:x64-windows-static=fail
faad2:x64-linux=fail
faad2:x64-osx=fail
fann:x64-windows-static=fail
farmhash:arm64-windows=fail
farmhash:arm-uwp=fail
farmhash:x64-uwp=fail
farmhash:x64-windows=fail
farmhash:x64-windows-static=fail
farmhash:x64-windows-static-md=fail
farmhash:x86-windows=fail
fastrtps:arm-uwp=fail
fastrtps:x64-uwp=fail
fastrtps:x64-windows-static=fail

View File

@ -2050,7 +2050,7 @@
},
"farmhash": {
"baseline": "1.1",
"port-version": 3
"port-version": 4
},
"fast-cpp-csv-parser": {
"baseline": "2021-01-03",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "46e338897fcb9436d4ac7f7cba2efd12df98567b",
"version-string": "1.1",
"port-version": 4
},
{
"git-tree": "9b4c6dc1b8fbb33fcca66dcb10c7186980e7058e",
"version-string": "1.1",