Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[farmhash] support Windows build #20506

Merged
merged 5 commits into from
Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ports/farmhash/farmhashConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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/")
34 changes: 22 additions & 12 deletions ports/farmhash/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
#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/commits/bbeede95c871ef4b1d1f0a9595c90c18da51dc17.diff"
FILENAME farmhash-windows-bbeede95c871.patch
SHA512 ba36493ad81448a06c63878d076d5bf6daabe52c754974709f225f77657a0bee992798685982751307f88927846ebbc03ccec120a9f201a70e799b1411709fa4
)

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
set(ENV{CXXFLAGS} "-maes -msse4.2")
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}")
2 changes: 1 addition & 1 deletion ports/farmhash/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
7 changes: 0 additions & 7 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,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
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2050,7 +2050,7 @@
},
"farmhash": {
"baseline": "1.1",
"port-version": 3
"port-version": 4
},
"fast-cpp-csv-parser": {
"baseline": "2021-01-03",
Expand Down
5 changes: 5 additions & 0 deletions versions/f-/farmhash.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "9ac4711813b4272f46acbdf0a70c01d7a78035ff",
"version-string": "1.1",
"port-version": 4
},
{
"git-tree": "9b4c6dc1b8fbb33fcca66dcb10c7186980e7058e",
"version-string": "1.1",
Expand Down