mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 02:18:42 +00:00
feat: use canonical peer priority to decide which peers to keep (#6981)
* feat: CRC32-C * feat: canonical peer priority calculation bep-40 * test: add test cases for IPv4 canonical peer priority * refactor: compare by canonical priority * fix: use network byte order for peer ports * test: more cases * build: xcode Co-authored-by: Dzmitry Neviadomski <nevack.d@gmail.com> * ci: test system crc32c library --------- Co-authored-by: Dzmitry Neviadomski <nevack.d@gmail.com>
This commit is contained in:
30
cmake/FindCRC32C.cmake
Normal file
30
cmake/FindCRC32C.cmake
Normal file
@@ -0,0 +1,30 @@
|
||||
if(CRC32C_PREFER_STATIC_LIB)
|
||||
set(CRC32C_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
if(WIN32)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .a .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
else()
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_path(CRC32C_INCLUDE_DIR
|
||||
NAMES crc32c/crc32c.h)
|
||||
find_library(CRC32C_LIBRARY
|
||||
NAMES crc32c)
|
||||
|
||||
set(CRC32C_INCLUDE_DIRS ${CRC32C_INCLUDE_DIR})
|
||||
set(CRC32C_LIBRARIES ${CRC32C_LIBRARY})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(CRC32C
|
||||
REQUIRED_VARS
|
||||
CRC32C_INCLUDE_DIR
|
||||
CRC32C_LIBRARY)
|
||||
|
||||
mark_as_advanced(CRC32C_INCLUDE_DIR CRC32C_LIBRARY)
|
||||
|
||||
if(CRC32C_PREFER_STATIC_LIB)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CRC32C_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
unset(CRC32C_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
|
||||
endif()
|
||||
Reference in New Issue
Block a user