Adding xxhash as a subtree (#25645)
This commit is contained in:
parent
e7536952a3
commit
d3e97d953b
3
BUILD
3
BUILD
|
|
@ -1862,6 +1862,9 @@ grpc_cc_library(
|
|||
srcs = [
|
||||
"src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc",
|
||||
],
|
||||
external_deps = [
|
||||
"xxhash",
|
||||
],
|
||||
language = "c++",
|
||||
deps = [
|
||||
"grpc_base",
|
||||
|
|
|
|||
1
BUILD.gn
1
BUILD.gn
|
|
@ -1233,6 +1233,7 @@ config("grpc_config") {
|
|||
"src/core/tsi/transport_security_grpc.cc",
|
||||
"src/core/tsi/transport_security_grpc.h",
|
||||
"src/core/tsi/transport_security_interface.h",
|
||||
"third_party/xxhash/xxhash.h",
|
||||
]
|
||||
deps = [
|
||||
"//third_party/zlib",
|
||||
|
|
|
|||
345
CMakeLists.txt
345
CMakeLists.txt
File diff suppressed because it is too large
Load Diff
2
Makefile
2
Makefile
|
|
@ -371,7 +371,7 @@ CXXFLAGS += -stdlib=libc++
|
|||
LDFLAGS += -framework CoreFoundation
|
||||
endif
|
||||
CFLAGS += -g
|
||||
CPPFLAGS += -g -Wall -Wextra -DOSATOMIC_USE_INLINED=1 -Ithird_party/abseil-cpp -Ithird_party/re2 -Ithird_party/upb -Isrc/core/ext/upb-generated -Isrc/core/ext/upbdefs-generated
|
||||
CPPFLAGS += -g -Wall -Wextra -DOSATOMIC_USE_INLINED=1 -Ithird_party/abseil-cpp -Ithird_party/re2 -Ithird_party/upb -Isrc/core/ext/upb-generated -Isrc/core/ext/upbdefs-generated -Ithird_party/xxhash
|
||||
COREFLAGS += -fno-exceptions
|
||||
LDFLAGS += -g
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ graft third_party/boringssl-with-bazel
|
|||
graft third_party/cares
|
||||
graft third_party/re2
|
||||
graft third_party/upb
|
||||
graft third_party/xxhash
|
||||
graft third_party/zlib
|
||||
include src/python/grpcio/_parallel_compile_patch.py
|
||||
include src/python/grpcio/_spawn_patch.py
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@ def _get_external_deps(external_deps):
|
|||
for dep in external_deps:
|
||||
if dep == "address_sorting":
|
||||
ret += ["//third_party/address_sorting"]
|
||||
elif dep == "xxhash":
|
||||
ret += ["//third_party/xxhash"]
|
||||
elif dep == "cares":
|
||||
ret += select({
|
||||
"//:grpc_no_ares": [],
|
||||
|
|
|
|||
|
|
@ -869,6 +869,7 @@ libs:
|
|||
- src/core/tsi/transport_security.h
|
||||
- src/core/tsi/transport_security_grpc.h
|
||||
- src/core/tsi/transport_security_interface.h
|
||||
- third_party/xxhash/xxhash.h
|
||||
src:
|
||||
- src/core/ext/filters/census/grpc_context.cc
|
||||
- src/core/ext/filters/client_channel/backend_metric.cc
|
||||
|
|
|
|||
|
|
@ -198,6 +198,7 @@ defaults:
|
|||
COREFLAGS: -fno-exceptions
|
||||
CPPFLAGS: -g -Wall -Wextra -DOSATOMIC_USE_INLINED=1 -Ithird_party/abseil-cpp -Ithird_party/re2
|
||||
-Ithird_party/upb -Isrc/core/ext/upb-generated -Isrc/core/ext/upbdefs-generated
|
||||
-Ithird_party/xxhash
|
||||
LDFLAGS: -g
|
||||
zlib:
|
||||
CFLAGS: -fvisibility=hidden
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
# Copyright 2017 gRPC authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set(_gRPC_XXHASH_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/xxhash")
|
||||
|
|
@ -14,6 +14,7 @@ if test "$PHP_GRPC" != "no"; then
|
|||
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/boringssl-with-bazel/src/include)
|
||||
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/re2)
|
||||
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/upb)
|
||||
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/xxhash)
|
||||
|
||||
LIBS="-lpthread $LIBS"
|
||||
|
||||
|
|
|
|||
|
|
@ -823,7 +823,8 @@ Pod::Spec.new do |s|
|
|||
'third_party/upb/upb/text_encode.h',
|
||||
'third_party/upb/upb/upb.h',
|
||||
'third_party/upb/upb/upb.hpp',
|
||||
'third_party/upb/upb/upb.int.h'
|
||||
'third_party/upb/upb/upb.int.h',
|
||||
'third_party/xxhash/xxhash.h'
|
||||
|
||||
ss.private_header_files = 'src/core/ext/filters/client_channel/backend_metric.h',
|
||||
'src/core/ext/filters/client_channel/backup_poller.h',
|
||||
|
|
@ -1398,7 +1399,8 @@ Pod::Spec.new do |s|
|
|||
'third_party/upb/upb/text_encode.h',
|
||||
'third_party/upb/upb/upb.h',
|
||||
'third_party/upb/upb/upb.hpp',
|
||||
'third_party/upb/upb/upb.int.h'
|
||||
'third_party/upb/upb/upb.int.h',
|
||||
'third_party/xxhash/xxhash.h'
|
||||
end
|
||||
|
||||
s.subspec 'Protobuf' do |ss|
|
||||
|
|
@ -1440,5 +1442,8 @@ Pod::Spec.new do |s|
|
|||
find third_party/re2/re2/ third_party/re2/util/ -type f \\( -name '*.h' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "re2/(.*)";#if COCOAPODS==1\\\n #include "third_party/re2/re2/\\1"\\\n#else\\\n #include "re2/\\1"\\\n#endif;g;s;#include "util/(.*)";#if COCOAPODS==1\\\n #include "third_party/re2/util/\\1"\\\n#else\\\n #include "util/\\1"\\\n#endif;g'
|
||||
find src/core/ -type f \\( -name '*.h' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "re2/(.*)";#if COCOAPODS==1\\\n #include "third_party/re2/re2/\\1"\\\n#else\\\n #include "re2/\\1"\\\n#endif;g'
|
||||
find src/core/ third_party/re2/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
|
||||
find src/core/ -type f \\( -name '*.h' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "xxhash.h";#if COCOAPODS==1\\\n #include "third_party/xxhash/xxhash.h"\\\n#else\\\n #include "xxhash.h"\\\n#endif;g'
|
||||
find third_party/xxhash -type f -name xxhash.h -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;@param([^,]*),;@param\\1 ,;g'
|
||||
find src/core/ third_party/xxhash/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
|
||||
END_OF_COMMAND
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1369,7 +1369,8 @@ Pod::Spec.new do |s|
|
|||
'third_party/upb/upb/upb.c',
|
||||
'third_party/upb/upb/upb.h',
|
||||
'third_party/upb/upb/upb.hpp',
|
||||
'third_party/upb/upb/upb.int.h'
|
||||
'third_party/upb/upb/upb.int.h',
|
||||
'third_party/xxhash/xxhash.h'
|
||||
ss.private_header_files = 'src/core/ext/filters/client_channel/backend_metric.h',
|
||||
'src/core/ext/filters/client_channel/backup_poller.h',
|
||||
'src/core/ext/filters/client_channel/client_channel.h',
|
||||
|
|
@ -1932,7 +1933,8 @@ Pod::Spec.new do |s|
|
|||
'third_party/upb/upb/text_encode.h',
|
||||
'third_party/upb/upb/upb.h',
|
||||
'third_party/upb/upb/upb.hpp',
|
||||
'third_party/upb/upb/upb.int.h'
|
||||
'third_party/upb/upb/upb.int.h',
|
||||
'third_party/xxhash/xxhash.h'
|
||||
end
|
||||
|
||||
# CFStream is now default. Leaving this subspec only for compatibility purpose.
|
||||
|
|
@ -2124,5 +2126,8 @@ Pod::Spec.new do |s|
|
|||
find third_party/re2/re2/ third_party/re2/util/ -type f \\( -name '*.h' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "re2/(.*)";#if COCOAPODS==1\\\n #include "third_party/re2/re2/\\1"\\\n#else\\\n #include "re2/\\1"\\\n#endif;g;s;#include "util/(.*)";#if COCOAPODS==1\\\n #include "third_party/re2/util/\\1"\\\n#else\\\n #include "util/\\1"\\\n#endif;g'
|
||||
find src/core/ -type f \\( -name '*.h' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "re2/(.*)";#if COCOAPODS==1\\\n #include "third_party/re2/re2/\\1"\\\n#else\\\n #include "re2/\\1"\\\n#endif;g'
|
||||
find src/core/ third_party/re2/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
|
||||
find src/core/ -type f \\( -name '*.h' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "xxhash.h";#if COCOAPODS==1\\\n #include "third_party/xxhash/xxhash.h"\\\n#else\\\n #include "xxhash.h"\\\n#endif;g'
|
||||
find third_party/xxhash -type f -name xxhash.h -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;@param([^,]*),;@param\\1 ,;g'
|
||||
find src/core/ third_party/xxhash/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
|
||||
END_OF_COMMAND
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2078,6 +2078,7 @@ Gem::Specification.new do |s|
|
|||
s.files += %w( third_party/upb/upb/upb.h )
|
||||
s.files += %w( third_party/upb/upb/upb.hpp )
|
||||
s.files += %w( third_party/upb/upb/upb.int.h )
|
||||
s.files += %w( third_party/xxhash/xxhash.h )
|
||||
s.files += %w( third_party/zlib/adler32.c )
|
||||
s.files += %w( third_party/zlib/compress.c )
|
||||
s.files += %w( third_party/zlib/crc32.c )
|
||||
|
|
|
|||
3
grpc.gyp
3
grpc.gyp
|
|
@ -60,6 +60,7 @@
|
|||
'-Ithird_party/upb',
|
||||
'-Isrc/core/ext/upb-generated',
|
||||
'-Isrc/core/ext/upbdefs-generated',
|
||||
'-Ithird_party/xxhash',
|
||||
],
|
||||
'ldflags': [
|
||||
'-g',
|
||||
|
|
@ -139,6 +140,7 @@
|
|||
'-Ithird_party/upb',
|
||||
'-Isrc/core/ext/upb-generated',
|
||||
'-Isrc/core/ext/upbdefs-generated',
|
||||
'-Ithird_party/xxhash',
|
||||
],
|
||||
'OTHER_CPLUSPLUSFLAGS': [
|
||||
'-g',
|
||||
|
|
@ -150,6 +152,7 @@
|
|||
'-Ithird_party/upb',
|
||||
'-Isrc/core/ext/upb-generated',
|
||||
'-Isrc/core/ext/upbdefs-generated',
|
||||
'-Ithird_party/xxhash',
|
||||
'-stdlib=libc++',
|
||||
'-std=c++11',
|
||||
'-Wno-error=deprecated-declarations',
|
||||
|
|
|
|||
|
|
@ -2003,6 +2003,7 @@
|
|||
<file baseinstalldir="/" name="third_party/upb/upb/upb.h" role="src" />
|
||||
<file baseinstalldir="/" name="third_party/upb/upb/upb.hpp" role="src" />
|
||||
<file baseinstalldir="/" name="third_party/upb/upb/upb.int.h" role="src" />
|
||||
<file baseinstalldir="/" name="third_party/xxhash/xxhash.h" role="src" />
|
||||
<file baseinstalldir="/" name="third_party/zlib/adler32.c" role="src" />
|
||||
<file baseinstalldir="/" name="third_party/zlib/compress.c" role="src" />
|
||||
<file baseinstalldir="/" name="third_party/zlib/crc32.c" role="src" />
|
||||
|
|
|
|||
4
setup.py
4
setup.py
|
|
@ -73,6 +73,7 @@ UPB_GRPC_GENERATED_INCLUDE = (os.path.join('src', 'core', 'ext',
|
|||
'upb-generated'),)
|
||||
UPBDEFS_GRPC_GENERATED_INCLUDE = (os.path.join('src', 'core', 'ext',
|
||||
'upbdefs-generated'),)
|
||||
XXHASH_INCLUDE = (os.path.join('third_party', 'xxhash'),)
|
||||
ZLIB_INCLUDE = (os.path.join('third_party', 'zlib'),)
|
||||
README = os.path.join(PYTHON_STEM, 'README.rst')
|
||||
|
||||
|
|
@ -299,7 +300,8 @@ EXTENSION_INCLUDE_DIRECTORIES = ((PYTHON_STEM,) + CORE_INCLUDE + ABSL_INCLUDE +
|
|||
ADDRESS_SORTING_INCLUDE + CARES_INCLUDE +
|
||||
RE2_INCLUDE + SSL_INCLUDE + UPB_INCLUDE +
|
||||
UPB_GRPC_GENERATED_INCLUDE +
|
||||
UPBDEFS_GRPC_GENERATED_INCLUDE + ZLIB_INCLUDE)
|
||||
UPBDEFS_GRPC_GENERATED_INCLUDE +
|
||||
XXHASH_INCLUDE + ZLIB_INCLUDE)
|
||||
|
||||
EXTENSION_LIBRARIES = ()
|
||||
if "linux" in sys.platform:
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@
|
|||
#include "absl/strings/str_join.h"
|
||||
#include "absl/strings/str_split.h"
|
||||
#include "re2/re2.h"
|
||||
#define XXH_INLINE_ALL
|
||||
#include "xxhash.h"
|
||||
|
||||
#include "src/core/ext/filters/client_channel/config_selector.h"
|
||||
#include "src/core/ext/filters/client_channel/resolver_registry.h"
|
||||
|
|
|
|||
|
|
@ -320,6 +320,7 @@
|
|||
include(cmake/re2.cmake)
|
||||
include(cmake/ssl.cmake)
|
||||
include(cmake/upb.cmake)
|
||||
include(cmake/xxhash.cmake)
|
||||
include(cmake/zlib.cmake)
|
||||
|
||||
if(_gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_IOS)
|
||||
|
|
@ -460,7 +461,7 @@
|
|||
for lib in libs:
|
||||
if lib.build not in ["all", "protoc", "tool", "test", "private"] or lib.boringssl: continue
|
||||
if lib.get('build_system', []) and 'cmake' not in lib.get('build_system', []): continue
|
||||
if lib.name in ['ares', 'benchmark', 're2', 'z']: continue # we build these using CMake instead
|
||||
if lib.name in ['ares', 'benchmark', 're2', 'xxhash', 'z']: continue # we build these using CMake instead
|
||||
if is_absl_lib(lib.name): continue # we build these using CMake instead
|
||||
cmake_libs.append(lib)
|
||||
%>
|
||||
|
|
@ -573,6 +574,7 @@
|
|||
<%text>${_gRPC_UPB_GENERATED_DIR}</%text>
|
||||
<%text>${_gRPC_UPB_GRPC_GENERATED_DIR}</%text>
|
||||
<%text>${_gRPC_UPB_INCLUDE_DIR}</%text>
|
||||
<%text>${_gRPC_XXHASH_INCLUDE_DIR}</%text>
|
||||
<%text>${_gRPC_ZLIB_INCLUDE_DIR}</%text>
|
||||
% if lib.build in ['test', 'private'] and lib.language == 'c++':
|
||||
third_party/googletest/googletest/include
|
||||
|
|
@ -653,6 +655,7 @@
|
|||
<%text>${_gRPC_UPB_GENERATED_DIR}</%text>
|
||||
<%text>${_gRPC_UPB_GRPC_GENERATED_DIR}</%text>
|
||||
<%text>${_gRPC_UPB_INCLUDE_DIR}</%text>
|
||||
<%text>${_gRPC_XXHASH_INCLUDE_DIR}</%text>
|
||||
<%text>${_gRPC_ZLIB_INCLUDE_DIR}</%text>
|
||||
% if tgt.build in ['test', 'private'] and tgt.language == 'c++':
|
||||
third_party/googletest/googletest/include
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/boringssl-with-bazel/src/include)
|
||||
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/re2)
|
||||
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/upb)
|
||||
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/xxhash)
|
||||
|
||||
LIBS="-lpthread $LIBS"
|
||||
|
||||
|
|
|
|||
|
|
@ -211,5 +211,8 @@
|
|||
find third_party/re2/re2/ third_party/re2/util/ -type f \\( -name '*.h' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "re2/(.*)";#if COCOAPODS==1\\\n #include "third_party/re2/re2/\\1"\\\n#else\\\n #include "re2/\\1"\\\n#endif;g;s;#include "util/(.*)";#if COCOAPODS==1\\\n #include "third_party/re2/util/\\1"\\\n#else\\\n #include "util/\\1"\\\n#endif;g'
|
||||
find src/core/ -type f \\( -name '*.h' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "re2/(.*)";#if COCOAPODS==1\\\n #include "third_party/re2/re2/\\1"\\\n#else\\\n #include "re2/\\1"\\\n#endif;g'
|
||||
find src/core/ third_party/re2/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
|
||||
find src/core/ -type f \\( -name '*.h' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "xxhash.h";#if COCOAPODS==1\\\n #include "third_party/xxhash/xxhash.h"\\\n#else\\\n #include "xxhash.h"\\\n#endif;g'
|
||||
find third_party/xxhash -type f -name xxhash.h -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;@param([^,]*),;@param\\1 ,;g'
|
||||
find src/core/ third_party/xxhash/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
|
||||
END_OF_COMMAND
|
||||
end
|
||||
|
|
|
|||
|
|
@ -250,5 +250,8 @@
|
|||
find third_party/re2/re2/ third_party/re2/util/ -type f \\( -name '*.h' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "re2/(.*)";#if COCOAPODS==1\\\n #include "third_party/re2/re2/\\1"\\\n#else\\\n #include "re2/\\1"\\\n#endif;g;s;#include "util/(.*)";#if COCOAPODS==1\\\n #include "third_party/re2/util/\\1"\\\n#else\\\n #include "util/\\1"\\\n#endif;g'
|
||||
find src/core/ -type f \\( -name '*.h' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "re2/(.*)";#if COCOAPODS==1\\\n #include "third_party/re2/re2/\\1"\\\n#else\\\n #include "re2/\\1"\\\n#endif;g'
|
||||
find src/core/ third_party/re2/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
|
||||
find src/core/ -type f \\( -name '*.h' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "xxhash.h";#if COCOAPODS==1\\\n #include "third_party/xxhash/xxhash.h"\\\n#else\\\n #include "xxhash.h"\\\n#endif;g'
|
||||
find third_party/xxhash -type f -name xxhash.h -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;@param([^,]*),;@param\\1 ,;g'
|
||||
find src/core/ third_party/xxhash/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
|
||||
END_OF_COMMAND
|
||||
end
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
# TODO(donnadionne): describe this package.
|
||||
cc_library(
|
||||
name = "xxhash",
|
||||
hdrs = [
|
||||
"xxhash.h",
|
||||
],
|
||||
# Must specify the includes so that the header file can be found.
|
||||
includes = [
|
||||
"",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
@ -2201,7 +2201,8 @@ src/cpp/thread_manager/thread_manager.h \
|
|||
src/cpp/util/byte_buffer_cc.cc \
|
||||
src/cpp/util/status.cc \
|
||||
src/cpp/util/string_ref.cc \
|
||||
src/cpp/util/time_cc.cc
|
||||
src/cpp/util/time_cc.cc \
|
||||
third_party/xxhash/xxhash.h
|
||||
|
||||
# This tag can be used to specify the character encoding of the source files
|
||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
|
||||
|
|
|
|||
|
|
@ -1982,7 +1982,8 @@ src/core/tsi/transport_security.cc \
|
|||
src/core/tsi/transport_security.h \
|
||||
src/core/tsi/transport_security_grpc.cc \
|
||||
src/core/tsi/transport_security_grpc.h \
|
||||
src/core/tsi/transport_security_interface.h
|
||||
src/core/tsi/transport_security_interface.h \
|
||||
third_party/xxhash/xxhash.h
|
||||
|
||||
# This tag can be used to specify the character encoding of the source files
|
||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
|
||||
|
|
|
|||
Loading…
Reference in New Issue