init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Close stale issues and PRs / stale (push) Successful in 13s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Close stale issues and PRs / stale (push) Successful in 13s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
This commit is contained in:
12
Telegram/ThirdParty/xxHash/cmake_unofficial/.gitignore
vendored
Normal file
12
Telegram/ThirdParty/xxHash/cmake_unofficial/.gitignore
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# cmake artifacts
|
||||
|
||||
CMakeCache.txt
|
||||
CMakeFiles
|
||||
Makefile
|
||||
cmake_install.cmake
|
||||
|
||||
|
||||
# make compilation results
|
||||
|
||||
*.dylib
|
||||
*.a
|
||||
211
Telegram/ThirdParty/xxHash/cmake_unofficial/CMakeLists.txt
vendored
Normal file
211
Telegram/ThirdParty/xxHash/cmake_unofficial/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,211 @@
|
||||
# To the extent possible under law, the author(s) have dedicated all
|
||||
# copyright and related and neighboring rights to this software to
|
||||
# the public domain worldwide. This software is distributed without
|
||||
# any warranty.
|
||||
#
|
||||
# For details, see <https://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
|
||||
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
|
||||
|
||||
set(XXHASH_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
|
||||
|
||||
file(STRINGS "${XXHASH_DIR}/xxhash.h" XXHASH_VERSION_MAJOR REGEX "^#define XXH_VERSION_MAJOR +([0-9]+) *$")
|
||||
string(REGEX REPLACE "^#define XXH_VERSION_MAJOR +([0-9]+) *$" "\\1" XXHASH_VERSION_MAJOR "${XXHASH_VERSION_MAJOR}")
|
||||
file(STRINGS "${XXHASH_DIR}/xxhash.h" XXHASH_VERSION_MINOR REGEX "^#define XXH_VERSION_MINOR +([0-9]+) *$")
|
||||
string(REGEX REPLACE "^#define XXH_VERSION_MINOR +([0-9]+) *$" "\\1" XXHASH_VERSION_MINOR "${XXHASH_VERSION_MINOR}")
|
||||
file(STRINGS "${XXHASH_DIR}/xxhash.h" XXHASH_VERSION_RELEASE REGEX "^#define XXH_VERSION_RELEASE +([0-9]+) *$")
|
||||
string(REGEX REPLACE "^#define XXH_VERSION_RELEASE +([0-9]+) *$" "\\1" XXHASH_VERSION_RELEASE "${XXHASH_VERSION_RELEASE}")
|
||||
set(XXHASH_VERSION_STRING "${XXHASH_VERSION_MAJOR}.${XXHASH_VERSION_MINOR}.${XXHASH_VERSION_RELEASE}")
|
||||
set(XXHASH_LIB_VERSION ${XXHASH_VERSION_STRING})
|
||||
set(XXHASH_LIB_SOVERSION "${XXHASH_VERSION_MAJOR}")
|
||||
mark_as_advanced(XXHASH_VERSION_MAJOR XXHASH_VERSION_MINOR XXHASH_VERSION_RELEASE XXHASH_VERSION_STRING XXHASH_LIB_VERSION XXHASH_LIB_SOVERSION)
|
||||
|
||||
if("${CMAKE_VERSION}" VERSION_LESS "3.13")
|
||||
#message(WARNING "CMake ${CMAKE_VERSION} has no CMP0077 policy: options will erase uncached/untyped normal vars!")
|
||||
else()
|
||||
cmake_policy (SET CMP0077 NEW)
|
||||
endif()
|
||||
if("${CMAKE_VERSION}" VERSION_LESS "3.0")
|
||||
project(xxHash C)
|
||||
else()
|
||||
cmake_policy (SET CMP0048 NEW)
|
||||
project(xxHash
|
||||
VERSION ${XXHASH_VERSION_STRING}
|
||||
LANGUAGES C)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Project build type" FORCE)
|
||||
set_property(CACHE CMAKE_BUILD_TYPE
|
||||
PROPERTY STRINGS "Debug" "Release" "RelWithDebInfo" "MinSizeRel")
|
||||
endif()
|
||||
if(NOT CMAKE_CONFIGURATION_TYPES)
|
||||
message(STATUS "xxHash build type: ${CMAKE_BUILD_TYPE}")
|
||||
endif()
|
||||
|
||||
# Enable assert() statements in debug builds
|
||||
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||
if("${CMAKE_VERSION}" VERSION_LESS "3.12")
|
||||
# add_compile_definitions is not available for older cmake => do nothing
|
||||
else()
|
||||
add_compile_definitions(XXH_DEBUGLEVEL=1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(BUILD_SHARED_LIBS "Build shared library" ON)
|
||||
option(XXHASH_BUILD_XXHSUM "Build the xxhsum binary" ON)
|
||||
|
||||
# If XXHASH is being bundled in another project, we don't want to
|
||||
# install anything. However, we want to let people override this, so
|
||||
# we'll use the XXHASH_BUNDLED_MODE variable to let them do that; just
|
||||
# set it to OFF in your project before you add_subdirectory(xxhash/cmake_unofficial).
|
||||
if(NOT DEFINED XXHASH_BUNDLED_MODE)
|
||||
if("${PROJECT_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
|
||||
set(XXHASH_BUNDLED_MODE OFF)
|
||||
else()
|
||||
set(XXHASH_BUNDLED_MODE ON)
|
||||
endif()
|
||||
endif()
|
||||
set(XXHASH_BUNDLED_MODE ${XXHASH_BUNDLED_MODE} CACHE BOOL "" FORCE)
|
||||
mark_as_advanced(XXHASH_BUNDLED_MODE)
|
||||
|
||||
# Allow people to choose whether to build shared or static libraries
|
||||
# via the BUILD_SHARED_LIBS option unless we are in bundled mode, in
|
||||
# which case we always use static libraries.
|
||||
include(CMakeDependentOption)
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON "NOT XXHASH_BUNDLED_MODE" OFF)
|
||||
|
||||
if("${CMAKE_VERSION}" VERSION_LESS "3.10")
|
||||
# Can not enable DISPATCH mode since it fails to recognize architecture.
|
||||
else()
|
||||
CMAKE_HOST_SYSTEM_INFORMATION(RESULT PLATFORM QUERY OS_PLATFORM)
|
||||
message(STATUS "Architecture: ${PLATFORM}")
|
||||
endif()
|
||||
|
||||
# libxxhash
|
||||
if((DEFINED DISPATCH) AND (DEFINED PLATFORM))
|
||||
# Only support DISPATCH option on x86_64.
|
||||
if(("${PLATFORM}" STREQUAL "x86_64") OR ("${PLATFORM}" STREQUAL "AMD64"))
|
||||
set(XXHSUM_DISPATCH ON)
|
||||
message(STATUS "Enable xxHash dispatch mode")
|
||||
add_library(xxhash "${XXHASH_DIR}/xxh_x86dispatch.c"
|
||||
"${XXHASH_DIR}/xxhash.c"
|
||||
)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXXHSUM_DISPATCH=1")
|
||||
else()
|
||||
add_library(xxhash "${XXHASH_DIR}/xxhash.c")
|
||||
endif()
|
||||
else()
|
||||
add_library(xxhash "${XXHASH_DIR}/xxhash.c")
|
||||
endif()
|
||||
add_library(${PROJECT_NAME}::xxhash ALIAS xxhash)
|
||||
|
||||
target_include_directories(xxhash
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${XXHASH_DIR}>
|
||||
$<INSTALL_INTERFACE:include/>)
|
||||
if (BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(xxhash PUBLIC XXH_EXPORT)
|
||||
endif ()
|
||||
set_target_properties(xxhash PROPERTIES
|
||||
SOVERSION "${XXHASH_LIB_SOVERSION}"
|
||||
VERSION "${XXHASH_VERSION_STRING}")
|
||||
|
||||
if(XXHASH_BUILD_XXHSUM)
|
||||
set(XXHSUM_DIR "${XXHASH_DIR}/cli")
|
||||
# xxhsum
|
||||
set(XXHSUM_SOURCES)
|
||||
if (XXHSUM_DISPATCH)
|
||||
list(APPEND XXHSUM_SOURCES "${XXHASH_DIR}/xxh_x86dispatch.c")
|
||||
endif()
|
||||
list(APPEND XXHSUM_SOURCES "${XXHSUM_DIR}/xxhsum.c"
|
||||
"${XXHSUM_DIR}/xsum_os_specific.c"
|
||||
"${XXHSUM_DIR}/xsum_output.c"
|
||||
"${XXHSUM_DIR}/xsum_sanity_check.c"
|
||||
"${XXHSUM_DIR}/xsum_bench.c"
|
||||
)
|
||||
add_executable(xxhsum ${XXHSUM_SOURCES})
|
||||
add_executable(${PROJECT_NAME}::xxhsum ALIAS xxhsum)
|
||||
|
||||
target_link_libraries(xxhsum PRIVATE xxhash)
|
||||
target_include_directories(xxhsum PRIVATE "${XXHASH_DIR}")
|
||||
endif(XXHASH_BUILD_XXHSUM)
|
||||
|
||||
# Extra warning flags
|
||||
include (CheckCCompilerFlag)
|
||||
if (XXHASH_C_FLAGS)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${XXHASH_C_FLAGS}")
|
||||
endif()
|
||||
|
||||
if(NOT XXHASH_BUNDLED_MODE)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
install(TARGETS xxhash
|
||||
EXPORT xxHashTargets
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
install(FILES "${XXHASH_DIR}/xxhash.h"
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
install(FILES "${XXHASH_DIR}/xxh3.h"
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
if(DISPATCH)
|
||||
install(FILES "${XXHASH_DIR}/xxh_x86dispatch.h"
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
endif()
|
||||
if(XXHASH_BUILD_XXHSUM)
|
||||
install(TARGETS xxhsum
|
||||
EXPORT xxHashTargets
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
install(FILES "${XXHSUM_DIR}/xxhsum.1"
|
||||
DESTINATION "${CMAKE_INSTALL_MANDIR}/man1")
|
||||
endif(XXHASH_BUILD_XXHSUM)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
set(xxHash_VERSION_CONFIG "${PROJECT_BINARY_DIR}/xxHashConfigVersion.cmake")
|
||||
set(xxHash_PROJECT_CONFIG "${PROJECT_BINARY_DIR}/xxHashConfig.cmake")
|
||||
set(xxHash_TARGETS_CONFIG "${PROJECT_BINARY_DIR}/xxHashTargets.cmake")
|
||||
set(xxHash_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/xxHash/")
|
||||
write_basic_package_version_file(${xxHash_VERSION_CONFIG}
|
||||
VERSION ${XXHASH_VERSION_STRING}
|
||||
COMPATIBILITY AnyNewerVersion)
|
||||
configure_package_config_file(
|
||||
${PROJECT_SOURCE_DIR}/xxHashConfig.cmake.in
|
||||
${xxHash_PROJECT_CONFIG}
|
||||
INSTALL_DESTINATION ${xxHash_CONFIG_INSTALL_DIR})
|
||||
if("${CMAKE_VERSION}" VERSION_LESS "3.0")
|
||||
set(XXHASH_EXPORT_SET xxhash)
|
||||
if(XXHASH_BUILD_XXHSUM)
|
||||
set(XXHASH_EXPORT_SET ${XXHASH_EXPORT_SET} xxhsum)
|
||||
endif()
|
||||
export(TARGETS ${XXHASH_EXPORT_SET}
|
||||
FILE ${xxHash_TARGETS_CONFIG}
|
||||
NAMESPACE ${PROJECT_NAME}::)
|
||||
else()
|
||||
export(EXPORT xxHashTargets
|
||||
FILE ${xxHash_TARGETS_CONFIG}
|
||||
NAMESPACE ${PROJECT_NAME}::)
|
||||
endif()
|
||||
|
||||
install(FILES ${xxHash_PROJECT_CONFIG} ${xxHash_VERSION_CONFIG}
|
||||
DESTINATION ${xxHash_CONFIG_INSTALL_DIR})
|
||||
install(EXPORT xxHashTargets
|
||||
DESTINATION ${xxHash_CONFIG_INSTALL_DIR}
|
||||
NAMESPACE ${PROJECT_NAME}::)
|
||||
|
||||
# configure and install pkg-config
|
||||
include(JoinPaths.cmake)
|
||||
set(PREFIX ${CMAKE_INSTALL_PREFIX})
|
||||
set(EXECPREFIX "\${prefix}")
|
||||
join_paths(INCLUDEDIR "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
join_paths(LIBDIR "\${prefix}" "${CMAKE_INSTALL_LIBDIR}")
|
||||
set(VERSION "${XXHASH_VERSION_STRING}")
|
||||
configure_file(${XXHASH_DIR}/libxxhash.pc.in ${CMAKE_BINARY_DIR}/libxxhash.pc @ONLY)
|
||||
|
||||
install(FILES ${CMAKE_BINARY_DIR}/libxxhash.pc
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
|
||||
endif(NOT XXHASH_BUNDLED_MODE)
|
||||
|
||||
include(CPack)
|
||||
23
Telegram/ThirdParty/xxHash/cmake_unofficial/JoinPaths.cmake
vendored
Normal file
23
Telegram/ThirdParty/xxHash/cmake_unofficial/JoinPaths.cmake
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
# This module provides function for joining paths
|
||||
# known from most languages
|
||||
#
|
||||
# SPDX-License-Identifier: (MIT OR CC0-1.0)
|
||||
# Copyright 2020 Jan Tojnar
|
||||
# https://github.com/jtojnar/cmake-snips
|
||||
#
|
||||
# Modelled after Python’s os.path.join
|
||||
# https://docs.python.org/3.7/library/os.path.html#os.path.join
|
||||
# Windows not supported
|
||||
function(join_paths joined_path first_path_segment)
|
||||
set(temp_path "${first_path_segment}")
|
||||
foreach(current_segment IN LISTS ARGN)
|
||||
if(NOT ("${current_segment}" STREQUAL ""))
|
||||
if(IS_ABSOLUTE "${current_segment}")
|
||||
set(temp_path "${current_segment}")
|
||||
else()
|
||||
set(temp_path "${temp_path}/${current_segment}")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
set(${joined_path} "${temp_path}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
37
Telegram/ThirdParty/xxHash/cmake_unofficial/README.md
vendored
Normal file
37
Telegram/ThirdParty/xxHash/cmake_unofficial/README.md
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
## Usage
|
||||
|
||||
### Way 1: import targets
|
||||
Build xxHash targets:
|
||||
|
||||
cd </path/to/xxHash/>
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ../cmake_unofficial [options]
|
||||
cmake --build .
|
||||
cmake --build . --target install #optional
|
||||
|
||||
Where possible options are:
|
||||
- `-DXXHASH_BUILD_ENABLE_INLINE_API=<ON|OFF>`: adds xxhash.c for the `-DXXH_INLINE_ALL` api. ON by default.
|
||||
- `-DXXHASH_BUILD_XXHSUM=<ON|OFF>`: build the command line binary. ON by default
|
||||
- `-DBUILD_SHARED_LIBS=<ON|OFF>`: build dynamic library. ON by default.
|
||||
- `-DCMAKE_INSTALL_PREFIX=<path>`: use custom install prefix path.
|
||||
- `-DDISPATCH=<ON|OFF>`: enable dispatch mode. OFF by default.
|
||||
|
||||
Add lines into downstream CMakeLists.txt:
|
||||
|
||||
find_package(xxHash 0.7 CONFIG REQUIRED)
|
||||
...
|
||||
target_link_libraries(MyTarget PRIVATE xxHash::xxhash)
|
||||
|
||||
### Way 2: Add subdirectory
|
||||
Add lines into downstream CMakeLists.txt:
|
||||
|
||||
option(BUILD_SHARED_LIBS "Build shared libs" OFF) #optional
|
||||
...
|
||||
set(XXHASH_BUILD_ENABLE_INLINE_API OFF) #optional
|
||||
set(XXHASH_BUILD_XXHSUM OFF) #optional
|
||||
add_subdirectory(</path/to/xxHash/cmake_unofficial/> </path/to/xxHash/build/> EXCLUDE_FROM_ALL)
|
||||
...
|
||||
target_link_libraries(MyTarget PRIVATE xxHash::xxhash)
|
||||
|
||||
4
Telegram/ThirdParty/xxHash/cmake_unofficial/xxHashConfig.cmake.in
vendored
Normal file
4
Telegram/ThirdParty/xxHash/cmake_unofficial/xxHashConfig.cmake.in
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/xxHashTargets.cmake)
|
||||
|
||||
Reference in New Issue
Block a user