1
0
mirror of https://github.com/facebook/proxygen.git synced 2026-10-24 01:33:54 +03:00

Use fbcode_builder's FindXxhash.cmake

Summary:
`thrift/cmake/FindXxhash.cmake` duplicated `build/fbcode_builder/CMake/FindXxhash.cmake`, differing only in the `Xxhash::xxhash` imported target it defines. Move that target into the fbcode_builder module and remove thrift's copy. fbthrift now installs the fbcode_builder module next to `FBThriftConfig.cmake`, as it already does for `FindGflags`, `FindGlog` and `FindLibUnwind`.

The only other user of the fbcode_builder module, cachelib, reads `Xxhash_LIBRARY` and doesn't define `Xxhash::xxhash` itself, so the new target can't collide with it.

Reviewed By: createdbysk

Differential Revision: D123971195

fbshipit-source-id: 18474a61011d23d7374c04208b18febaee0ed1af
This commit is contained in:
Victor Zverovich
2026-10-09 07:05:09 -07:00
committed by meta-codesync[bot]
parent 3b30d4c6a7
commit 86842c6cf0

View File

@@ -18,6 +18,7 @@
# Xxhash_FOUND
# Xxhash_INCLUDE_DIR
# Xxhash_LIBRARY
# Xxhash::xxhash (imported target)
#
find_path(Xxhash_INCLUDE_DIR NAMES xxhash.h)
@@ -37,4 +38,13 @@ if (Xxhash_FOUND)
message(STATUS "Found xxhash: ${Xxhash_LIBRARY}")
endif()
if (Xxhash_FOUND AND NOT TARGET Xxhash::xxhash)
add_library(Xxhash::xxhash UNKNOWN IMPORTED)
set_target_properties(
Xxhash::xxhash
PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${Xxhash_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${Xxhash_INCLUDE_DIR}")
endif()
mark_as_advanced(Xxhash_INCLUDE_DIR Xxhash_LIBRARY)