From ad6bce211e3d5e0bdfcbc32391e2e011e93d5f7a Mon Sep 17 00:00:00 2001 From: Park DongHa Date: Tue, 12 Oct 2021 02:28:01 +0900 Subject: [PATCH] [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 --- ports/farmhash/farmhashConfig.cmake | 5 ++++- ports/farmhash/portfile.cmake | 34 +++++++++++++++++++---------- ports/farmhash/vcpkg.json | 2 +- scripts/ci.baseline.txt | 7 ------ versions/baseline.json | 2 +- versions/f-/farmhash.json | 5 +++++ 6 files changed, 33 insertions(+), 22 deletions(-) diff --git a/ports/farmhash/farmhashConfig.cmake b/ports/farmhash/farmhashConfig.cmake index b7b4cd1b0e..e091d5c051 100644 --- a/ports/farmhash/farmhashConfig.cmake +++ b/ports/farmhash/farmhashConfig.cmake @@ -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/") diff --git a/ports/farmhash/portfile.cmake b/ports/farmhash/portfile.cmake index 801e057065..496e5e317e 100644 --- a/ports/farmhash/portfile.cmake +++ b/ports/farmhash/portfile.cmake @@ -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}) \ No newline at end of file +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}") diff --git a/ports/farmhash/vcpkg.json b/ports/farmhash/vcpkg.json index 1d85ed1a1a..9624088907 100644 --- a/ports/farmhash/vcpkg.json +++ b/ports/farmhash/vcpkg.json @@ -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" diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 25c6ef1fe7..a8543d49ca 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -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 diff --git a/versions/baseline.json b/versions/baseline.json index 8b00998084..a1adb4c6c0 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2050,7 +2050,7 @@ }, "farmhash": { "baseline": "1.1", - "port-version": 3 + "port-version": 4 }, "fast-cpp-csv-parser": { "baseline": "2021-01-03", diff --git a/versions/f-/farmhash.json b/versions/f-/farmhash.json index b80cf8bcf1..399d97dad8 100644 --- a/versions/f-/farmhash.json +++ b/versions/f-/farmhash.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "46e338897fcb9436d4ac7f7cba2efd12df98567b", + "version-string": "1.1", + "port-version": 4 + }, { "git-tree": "9b4c6dc1b8fbb33fcca66dcb10c7186980e7058e", "version-string": "1.1",