1cc_defaults {
2    name: "epid_cflags",
3    host_supported: true,
4    target: {
5        darwin: {
6            enabled: false,
7        },
8    },
9    cflags: [
10        "-Wno-missing-braces",
11        "-Wno-unknown-pragmas",
12        "-Wno-typedef-redefinition",
13        "-Wno-missing-field-initializers",
14        "-Wno-for-loop-analysis",
15        "-Wno-unused-const-variable",
16        "-Wno-null-pointer-arithmetic",
17        "-fexceptions",
18        "-fPIC",
19        "-O2",
20    ],
21}
22
23cc_library {
24    name: "libippcp",
25    defaults: ["epid_cflags"],
26    srcs: [
27        "ext/ipp/sources/ippcp/*.c",
28    ],
29    exclude_srcs: [
30        "ext/ipp/sources/ippcp/*md5.c",
31        "ext/ipp/sources/ippcp/*sm2*.c",
32        "ext/ipp/sources/ippcp/*sm3.c",
33        "ext/ipp/sources/ippcp/cpinit.c",
34        "ext/ipp/sources/ippcp/pcpaes*.c",
35        "ext/ipp/sources/ippcp/pcparcfour*.c",
36        "ext/ipp/sources/ippcp/pcpdes*.c",
37        "ext/ipp/sources/ippcp/pcpdlp*.c",
38        "ext/ipp/sources/ippcp/pcphmac*.c",
39        "ext/ipp/sources/ippcp/pcpmain.c",
40        "ext/ipp/sources/ippcp/pcpmd5*.c",
41        "ext/ipp/sources/ippcp/pcpmont_expbinbnu_sscm.c",
42        "ext/ipp/sources/ippcp/pcpmont_expwinbnu.c",
43        "ext/ipp/sources/ippcp/pcpmont_expwinbnu_sscm.c",
44        "ext/ipp/sources/ippcp/pcpng*.c",
45        "ext/ipp/sources/ippcp/pcpprime*.c",
46        "ext/ipp/sources/ippcp/pcprij*.c",
47        "ext/ipp/sources/ippcp/pcprsa*.c",
48        "ext/ipp/sources/ippcp/pcpsha1*.c",
49        "ext/ipp/sources/ippcp/pcpsm3*.c",
50        "ext/ipp/sources/ippcp/pcpsms4*.c",
51        "ext/ipp/sources/ippcp/pcptdes*.c",
52    ],
53    cflags: [
54        "-D_IPP_DEBUG",
55        "-D_IPP_C99",
56        "-D_IPP_v50_",
57        "-D_PX",
58        "-D_DISABLE_ECP_SM2_",
59        "-D_DISABLE_ALG_SHA224_",
60        "-D_DISABLE_ALG_SHA512_224_",
61        "-D_DISABLE_ALG_MD5_",
62        "-D_DISABLE_ALG_SM3_",
63        "-Wno-unused-function",
64        "-Wno-date-time",
65        "-Wno-#pragma-messages",
66    ],
67    local_include_dirs: [
68        "ext/ipp/sources/ippcp/",
69        "ext/ipp/sources/include/",
70    ],
71    export_include_dirs: [
72        "ext/ipp/include/",
73    ],
74}
75
76cc_library {
77    name: "libepid_common",
78    defaults: ["epid_cflags"],
79    srcs: [
80        "epid/common/1.1/src/*.c",
81        "epid/common/math/src/*.c",
82        "epid/common/src/*.c",
83    ],
84    local_include_dirs: [
85        "epid/common/math/src",
86        "epid/common/math/",
87        "epid/common/src",
88    ],
89    static_libs: [
90        "libippcp",
91    ],
92}
93
94cc_library {
95    name: "libepid_member",
96    defaults: ["epid_cflags"],
97    srcs: [
98        "epid/member/src/*.c",
99        "epid/member/tpm2/src/*.c",
100    ],
101    export_include_dirs: [
102        ".",
103    ],
104    static_libs: [
105        "libepid_common",
106        "libippcp",
107    ],
108}
109
110cc_library {
111    name: "libepid_verifier",
112    defaults: ["epid_cflags"],
113    srcs: [
114        "epid/verifier/1.1/src/*.c",
115        "epid/verifier/src/*.c",
116    ],
117    export_include_dirs: [
118        ".",
119    ],
120    static_libs: [
121        "libepid_common",
122        "libippcp",
123    ],
124}
125
126cc_library {
127    name: "libepid_util",
128    defaults: ["epid_cflags"],
129    srcs: [
130        "example/util/src/*.c",
131    ],
132    export_include_dirs: [
133        "example",
134    ],
135    static_libs: [
136        "libepid_common",
137    ],
138}
139
140cc_library {
141    name: "libargtable3",
142    defaults: ["epid_cflags"],
143    srcs: [
144        "ext/argtable3/argtable3.c",
145    ],
146    export_include_dirs: [
147        "ext/argtable3",
148    ],
149}
150
151cc_library {
152    name: "libepid_common_testhelper",
153    defaults: ["epid_cflags"],
154    srcs: [
155        "epid/common-testhelper/*cc",
156        "epid/common-testhelper/1.1/*cc",
157    ],
158    local_include_dirs: [
159        "ext",
160        "epid/common-testhelper/",
161        "epid/common-testhelper/1.1",
162    ],
163    static_libs: [
164        "libepid_member",
165        "libepid_verifier",
166        "libepid_common",
167        "libippcp",
168        "libgtest",
169    ],
170}
171
172cc_binary {
173    name: "epid_verifysig",
174    defaults: ["epid_cflags"],
175    srcs: [
176        "example/verifysig/src/*.c",
177    ],
178    local_include_dirs: [
179        "example/verifysig",
180    ],
181    static_libs: [
182        "libepid_verifier",
183        "libepid_common",
184        "libepid_util",
185        "libippcp",
186        "libargtable3",
187    ],
188}
189
190cc_binary {
191    name: "epid_signmsg",
192    defaults: ["epid_cflags"],
193    srcs: [
194        "example/signmsg/src/*.c",
195    ],
196    local_include_dirs: [
197        "example/signmsg",
198    ],
199    static_libs: [
200        "libepid_member",
201        "libepid_common",
202        "libepid_util",
203        "libippcp",
204        "libargtable3",
205    ],
206}
207
208cc_test {
209    name: "epid_common_testhelper_utest",
210    defaults: ["epid_cflags"],
211    srcs: [
212        "epid/common-testhelper/unittests/*cc",
213    ],
214    local_include_dirs: [
215        "ext",
216    ],
217    static_libs: [
218        "libepid_common_testhelper",
219        "libepid_member",
220        "libepid_verifier",
221        "libepid_common",
222        "libippcp",
223    ],
224}
225
226cc_test {
227    name: "epid_common_utest",
228    defaults: ["epid_cflags"],
229    srcs: [
230        "epid/common/math/unittests/*cc",
231        "epid/common/unittests/*cc",
232        "epid/common/1.1/unittests/*cc",
233    ],
234    local_include_dirs: [
235        "epid/common/unittests/",
236    ],
237    static_libs: [
238        "libepid_common_testhelper",
239        "libepid_member",
240        "libepid_verifier",
241        "libepid_common",
242        "libippcp",
243    ],
244}
245
246cc_test {
247    name: "epid_member_utest",
248    defaults: ["epid_cflags"],
249    srcs: [
250        "epid/member/unittests/*cc",
251        "epid/member/tpm2/unittests/tpm2_wrapper-testhelper.cc",
252    ],
253    local_include_dirs: [
254        "ext",
255    ],
256    static_libs: [
257        "libepid_common_testhelper",
258        "libepid_verifier",
259        "libepid_member",
260        "libepid_common",
261        "libippcp",
262    ],
263}
264
265cc_test {
266    name: "epid_member_tpm2_utest",
267    defaults: ["epid_cflags"],
268    srcs: [
269        "epid/member/tpm2/unittests/*.cc",
270    ],
271    exclude_srcs: [
272        "epid/member/tpm2/unittests/*tss-test.cc",
273    ],
274    static_libs: [
275        "libepid_common_testhelper",
276        "libepid_verifier",
277        "libepid_member",
278        "libepid_common",
279        "libippcp",
280
281    ],
282}
283
284cc_test {
285    name: "epid_verifier_utest",
286    defaults: ["epid_cflags"],
287    srcs: [
288        "epid/verifier/unittests/*cc",
289        "epid/verifier/1.1/unittests/*cc",
290    ],
291    static_libs: [
292        "libepid_common_testhelper",
293        "libepid_verifier",
294        "libepid_member",
295        "libepid_common",
296        "libippcp",
297    ],
298}
299