forked from jupp0r/prometheus-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
repositories.bzl
164 lines (151 loc) · 3.62 KB
/
repositories.bzl
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
_CIVETWEB_BUILD_FILE = """
licenses(["notice"]) # MIT license
config_setting(
name = "darwin",
values = {"cpu": "darwin"},)
config_setting(
name = "darwin_x86_64",
values = {"cpu": "darwin_x86_64"},
)
config_setting(
name = "windows",
values = { "cpu": "x64_windows" },
)
config_setting(
name = "windows_msvc",
values = {"cpu": "x64_windows_msvc"},
)
cc_library(
name = "libcivetweb",
srcs = [
"src/civetweb.c",
],
hdrs = [
"include/civetweb.h",
],
copts = [
"-DUSE_IPV6",
"-DNDEBUG",
"-DNO_CGI",
"-DNO_CACHING",
"-DNO_SSL",
"-DNO_FILES",
],
includes = [
"include",
],
linkopts = select({
":windows": [],
":windows_msvc": [],
"//conditions:default": ["-lpthread"],
}) + select({
":darwin": [],
":darwin_x86_64": [],
":windows": [],
":windows_msvc": [],
"//conditions:default": ["-lrt"],
}),
textual_hdrs = [
"src/file_ops.inl",
"src/md5.inl",
"src/handle_form.inl",
],
visibility = ["//visibility:public"],
)
cc_library(
name = "civetweb",
srcs = [
"src/CivetServer.cpp",
],
hdrs = [
"include/CivetServer.h",
],
deps = [
":libcivetweb",
],
copts = [
"-DUSE_IPV6",
"-DNDEBUG",
"-DNO_CGI",
"-DNO_CACHING",
"-DNO_SSL",
"-DNO_FILES",
],
includes = [
"include",
],
linkopts = select({
":windows": [],
":windows_msvc": [],
"//conditions:default": ["-lpthread"],
}) + select({
":darwin": [],
":darwin_x86_64": [],
":windows": [],
":windows_msvc": [],
"//conditions:default": ["-lrt"],
}),
visibility = ["//visibility:public"],
)
"""
_CPR_BUILD_FILE = """
licenses(["notice"]) # Apache-2.0 license
cc_library(
name = "cpr",
srcs = glob([
"cpr/*.cpp",
]),
hdrs = glob([
"include/cpr/*.h",
]),
includes = [
"include",
],
linkopts = [
"-lcurl",
],
visibility = ["//visibility:public"],
)
"""
def load_civetweb():
native.new_http_archive(
name = "civetweb",
strip_prefix = "civetweb-1.9.1",
sha256 = "880d741724fd8de0ebc77bc5d98fa673ba44423dc4918361c3cd5cf80955e36d",
urls = [
"https://github.com/civetweb/civetweb/archive/v1.9.1.tar.gz",
],
build_file_content = _CIVETWEB_BUILD_FILE,
)
def load_com_google_googletest():
native.http_archive(
name = "com_google_googletest",
strip_prefix = "googletest-master",
urls = [
"https://github.com/google/googletest/archive/master.zip",
],
)
def load_com_github_google_benchmark():
native.http_archive(
name = "com_github_google_benchmark",
sha256 = "f8e525db3c42efc9c7f3bc5176a8fa893a9a9920bbd08cef30fb56a51854d60d",
strip_prefix = "benchmark-1.4.1",
urls = [
"https://github.com/google/benchmark/archive/v1.4.1.tar.gz",
],
)
def load_com_github_whoshuu_cpr():
native.new_http_archive(
name = "com_github_whoshuu_cpr",
sha256 = "82597627e8b2aef1f0482631c9b11595c63a7565bb462a5995d126da4419ac99",
strip_prefix = "cpr-1.3.0",
urls = [
"https://github.com/whoshuu/cpr/archive/1.3.0.tar.gz",
],
build_file_content = _CPR_BUILD_FILE,
)
def prometheus_cpp_repositories():
load_civetweb()
load_com_google_googletest()
load_com_github_google_benchmark()
load_com_github_whoshuu_cpr()