forked from bytedance/monolith
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkafka.BUILD
132 lines (126 loc) · 3.39 KB
/
kafka.BUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Description:
# Kafka C/C++ (librdkafka) client library
licenses(["notice"]) # 2-clause BSD license
exports_files(["LICENSE"])
cc_library(
name = "kafka",
srcs = glob(
[
"src-cpp/*.h",
"src-cpp/*.cpp",
"src/*.c",
"src/*.h",
],
exclude = [
"src/lz4.c",
"src/lz4.h",
"src/lz4frame.c",
"src/lz4frame.h",
"src/lz4frame_static.h",
"src/lz4hc.c",
"src/lz4hc.h",
"src/lz4opt.h",
"src/rddl.c",
"src/rddl.h",
"src/rdkafka_plugin.c",
"src/rdkafka_plugin.h",
"src/rdkafka_sasl_cyrus.c",
"src/rdkafka_sasl_win32.c",
"src/rdxxhash.c",
"src/rdxxhash.h",
"src/win32_config.h",
],
) + [
"config/config.h",
"config/src/set1_host.c",
"config/src/win32_config.h",
] + select({
"@bazel_tools//src/conditions:windows": [
"src/rdkafka_sasl_win32.c",
],
"//conditions:default": [],
}),
hdrs = [
"config/config.h",
"config/src/set1_host.c",
"config/src/win32_config.h",
"src/rdxxhash.c",
"src/rdxxhash.h",
],
defines = [
"LIBRDKAFKA_STATICLIB",
"WIN32_LEAN_AND_MEAN",
"XXH_PRIVATE_API",
],
includes = [
"config/src",
"src",
"src-cpp",
],
linkopts = [],
visibility = ["//visibility:public"],
deps = [
"@boringssl//:ssl",
"@lz4",
"@zlib",
"@zstd",
],
)
genrule(
name = "set1_host_c",
outs = ["config/src/set1_host.c"],
cmd = "\n".join([
"cat <<'EOF' >$@",
"#include <openssl/ssl.h>",
"int SSL_set1_host(SSL *s, const char *hostname) {",
" return X509_VERIFY_PARAM_set1_host(SSL_get0_param(s), hostname, 0);",
"}",
"EOF",
]),
)
genrule(
name = "win32_config_h",
outs = ["config/src/win32_config.h"],
cmd = "\n".join([
"cat <<'EOF' >$@",
"#define WITH_SSL 1",
"#define WITH_ZLIB 1",
"#define WITH_SNAPPY 1",
"#define WITH_ZSTD 1",
"#define WITH_ZSTD_STATIC 1",
"#define WITH_LZ4_EXT 1",
"#define WITH_SASL 1",
"#define WITH_SASL_SCRAM 1",
"#define WITH_SASL_OAUTHBEARER 1",
"#define WITH_HDRHISTOGRAM 1",
"#define WITH_PLUGINS 0",
"#define ENABLE_DEVEL 0",
"#define BUILT_WITH \"SSL ZLIB SNAPPY ZSTD LZ4 SASL SASL_SCRAM SASL_OAUTHBEARER HDRHISTOGRAM\"",
"// maintain the order below",
"#include <windows.h>",
"#include <openssl/x509.h>",
"#include <wincrypt.h>",
"EOF",
]),
)
genrule(
name = "config_h",
outs = ["config/config.h"],
cmd = "\n".join([
"cat <<'EOF' >$@",
"#define WITH_SSL 1",
"#define WITH_ZLIB 1",
"#define WITH_SNAPPY 1",
"#define WITH_ZSTD 1",
"#define WITH_ZSTD_STATIC 1",
"#define WITH_LZ4_EXT 1",
"#define WITH_SASL 1",
"#define WITH_SASL_SCRAM 1",
"#define WITH_SASL_OAUTHBEARER 1",
"#define WITH_HDRHISTOGRAM 1",
"#define WITH_PLUGINS 0",
"#define ENABLE_DEVEL 0",
"#define BUILT_WITH \"SSL ZLIB SNAPPY ZSTD LZ4 SASL SASL_SCRAM SASL_OAUTHBEARER HDRHISTOGRAM\"",
"EOF",
]),
)