forked from Cylix/cpp_redis
-
Notifications
You must be signed in to change notification settings - Fork 202
/
BUILD.bazel
137 lines (130 loc) · 4.95 KB
/
BUILD.bazel
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
133
134
135
136
137
cc_library(
name = "cpp_redis",
srcs = [
"sources/builders/array_builder.cpp",
"sources/builders/builders_factory.cpp",
"sources/builders/bulk_string_builder.cpp",
"sources/builders/error_builder.cpp",
"sources/builders/integer_builder.cpp",
"sources/builders/reply_builder.cpp",
"sources/builders/simple_string_builder.cpp",
"sources/core/client.cpp",
"sources/core/consumer.cpp",
"sources/core/reply.cpp",
"sources/core/sentinel.cpp",
"sources/core/subscriber.cpp",
"sources/core/types.cpp",
"sources/misc/dispatch_queue.cpp",
"sources/misc/logger.cpp",
"sources/network/redis_connection.cpp",
"sources/network/tcp_client.cpp",
],
hdrs = [
"includes/cpp_redis/builders/array_builder.hpp",
"includes/cpp_redis/builders/builder_iface.hpp",
"includes/cpp_redis/builders/builders_factory.hpp",
"includes/cpp_redis/builders/bulk_string_builder.hpp",
"includes/cpp_redis/builders/error_builder.hpp",
"includes/cpp_redis/builders/integer_builder.hpp",
"includes/cpp_redis/builders/reply_builder.hpp",
"includes/cpp_redis/builders/simple_string_builder.hpp",
"includes/cpp_redis/core/client.hpp",
"includes/cpp_redis/core/consumer.hpp",
"includes/cpp_redis/core/reply.hpp",
"includes/cpp_redis/core/sentinel.hpp",
"includes/cpp_redis/core/subscriber.hpp",
"includes/cpp_redis/core/types.hpp",
"includes/cpp_redis/cpp_redis",
"includes/cpp_redis/helpers/generate_rand.hpp",
"includes/cpp_redis/helpers/variadic_template.hpp",
"includes/cpp_redis/impl/client.ipp",
"includes/cpp_redis/impl/types.hpp",
"includes/cpp_redis/misc/convert.hpp",
"includes/cpp_redis/misc/deprecated.hpp",
"includes/cpp_redis/misc/dispatch_queue.hpp",
"includes/cpp_redis/misc/error.hpp",
"includes/cpp_redis/misc/logger.hpp",
"includes/cpp_redis/misc/macro.hpp",
"includes/cpp_redis/misc/optional.hpp",
"includes/cpp_redis/network/redis_connection.hpp",
"includes/cpp_redis/network/tcp_client.hpp",
"includes/cpp_redis/network/tcp_client_iface.hpp",
],
strip_include_prefix = "includes",
visibility = ["//visibility:public"],
deps = ["@tacopie"],
)
cc_binary(
name = "example_cpp_redis_subscriber",
srcs = ["examples/cpp_redis_subscriber.cpp"],
# TODO (steple): For windows, link ws2_32 instead.
linkopts = ["-lpthread"],
deps = ["cpp_redis"],
)
cc_binary(
name = "example_cpp_redis_kill",
srcs = ["examples/cpp_redis_kill.cpp"],
# TODO (steple): For windows, link ws2_32 instead.
linkopts = ["-lpthread"],
deps = ["cpp_redis"],
)
cc_binary(
name = "example_cpp_redis_client",
srcs = [
"examples/cpp_redis_client.cpp",
"examples/winsock_initializer.h"
],
# TODO (steple): For windows, link ws2_32 instead.
linkopts = ["-lpthread"],
deps = ["cpp_redis"],
)
cc_binary(
name = "example_cpp_redis_logger",
srcs = ["examples/cpp_redis_logger.cpp"],
# TODO (steple): For windows, link ws2_32 instead.
linkopts = ["-lpthread"],
deps = ["cpp_redis"],
)
cc_binary(
name = "example_cpp_redis_future_client",
srcs = ["examples/cpp_redis_future_client.cpp"],
# TODO (steple): For windows, link ws2_32 instead.
linkopts = ["-lpthread"],
deps = ["cpp_redis"],
)
cc_binary(
name = "example_cpp_redis_high_availability_client",
srcs = ["examples/cpp_redis_high_availability_client.cpp"],
# TODO (steple): For windows, link ws2_32 instead.
linkopts = ["-lpthread"],
deps = ["cpp_redis"],
)
# Note: These tests should be broken up more - each file should have its own
# call to RUN_ALL_TESTS.
# For example, the number of individual cases in all files in srcs is 62. If
# the shard count is set to 62, bazel tells us "Having more than 50 shards is
# indicative of poor test organization. Please reduce the number of shards."
# Note 2: Some tests require exclusive access to a redis server running at the
# default port. Therefor we can only run 1 test at a time.
cc_test(
name = "test",
size = "small",
srcs = [
"tests/sources/main.cpp",
"tests/sources/spec/builders/array_builder_spec.cpp",
"tests/sources/spec/builders/builders_factory_spec.cpp",
"tests/sources/spec/builders/bulk_string_builder_spec.cpp",
"tests/sources/spec/builders/error_builder_spec.cpp",
"tests/sources/spec/builders/integer_builder_spec.cpp",
"tests/sources/spec/builders/reply_builder_spec.cpp",
"tests/sources/spec/builders/simple_string_builder_spec.cpp",
"tests/sources/spec/redis_client_spec.cpp",
"tests/sources/spec/redis_subscriber_spec.cpp",
"tests/sources/spec/reply_spec.cpp",
],
shard_count = 1, # See note above.
deps = [
"cpp_redis",
"@gtest",
],
)