2020-06-29 18:16:32 -07:00
|
|
|
COPTS = [] + select({
|
|
|
|
"@bazel_tools//src/conditions:windows": [
|
|
|
|
"-D_CRT_DECLARE_NONSTDC_NAMES=0", # don't define off_t, to avoid conflicts
|
|
|
|
],
|
|
|
|
"//conditions:default": [
|
|
|
|
],
|
2020-07-13 15:31:46 -07:00
|
|
|
}) + select({
|
|
|
|
"@//:msvc-cl": [
|
|
|
|
],
|
|
|
|
"//conditions:default": [
|
|
|
|
# Old versions of GCC (e.g. 4.9.2) can fail to compile Redis's C without this.
|
|
|
|
"-std=c99",
|
|
|
|
],
|
2020-06-29 18:16:32 -07:00
|
|
|
})
|
|
|
|
|
|
|
|
# This library is for internal hiredis use, because hiredis assumes a
|
|
|
|
# different include prefix for itself than external libraries do.
|
|
|
|
cc_library(
|
|
|
|
name = "_hiredis",
|
|
|
|
hdrs = [
|
|
|
|
"dict.c",
|
|
|
|
],
|
|
|
|
copts = COPTS,
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "hiredis",
|
|
|
|
srcs = glob(
|
|
|
|
[
|
|
|
|
"*.c",
|
|
|
|
"*.h",
|
|
|
|
],
|
|
|
|
exclude =
|
|
|
|
[
|
2020-07-09 18:45:44 -07:00
|
|
|
"ssl.c",
|
2020-06-29 18:16:32 -07:00
|
|
|
"test.c",
|
|
|
|
],
|
|
|
|
),
|
|
|
|
hdrs = glob([
|
|
|
|
"*.h",
|
|
|
|
"adapters/*.h",
|
|
|
|
]),
|
2020-07-09 18:45:44 -07:00
|
|
|
copts = COPTS,
|
2020-06-29 18:16:32 -07:00
|
|
|
include_prefix = "hiredis",
|
|
|
|
deps = [
|
|
|
|
":_hiredis",
|
|
|
|
],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|