xref: /aosp_15_r20/external/cronet/third_party/brotli/Android.bp (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1// Copyright (C) 2022 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// This file is automatically generated by gn2bp/gen_android_bp.py. Do not edit.
16
17// GN: Package-Artificial
18package {
19    default_applicable_licenses: [
20        "external_cronet_third_party_brotli_license",
21    ],
22}
23
24// GN: License-Artificial
25license {
26    name: "external_cronet_third_party_brotli_license",
27    visibility: [
28        ":__subpackages__",
29    ],
30    license_text: [
31        "LICENSE",
32    ],
33    license_kinds: [
34        "SPDX-license-identifier-MIT",
35    ],
36}
37
38// GN: //third_party/brotli:common
39cc_library_static {
40    name: "cronet_aml_third_party_brotli_common",
41    srcs: [
42        "common/constants.c",
43        "common/context.c",
44        "common/dictionary.c",
45        "common/platform.c",
46        "common/shared_dictionary.c",
47        "common/transform.c",
48    ],
49    defaults: [
50        "cronet_aml_cc_defaults",
51    ],
52    cflags: [
53        "-DANDROID",
54        "-DANDROID_NDK_VERSION_ROLL=r26b_1",
55        "-DCR_CLANG_REVISION=\"llvmorg-19-init-8091-gab037c4f-22\"",
56        "-DCR_LIBCXX_REVISION=e3b94d0e5b86883fd77696bf10dc33ba250ba99b",
57        "-DDYNAMIC_ANNOTATIONS_ENABLED=0",
58        "-DHAVE_SYS_UIO_H",
59        "-DNDEBUG",
60        "-DNO_UNWIND_TABLES",
61        "-DNVALGRIND",
62        "-DOFFICIAL_BUILD",
63        "-D_GNU_SOURCE",
64        "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
65        "-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE",
66        "-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
67        "-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__",
68        "-D__STDC_CONSTANT_MACROS",
69        "-D__STDC_FORMAT_MACROS",
70        "-fdata-sections",
71        "-ffunction-sections",
72        "-fno-asynchronous-unwind-tables",
73        "-fno-unwind-tables",
74        "-fstack-protector",
75        "-fvisibility-inlines-hidden",
76        "-fvisibility=hidden",
77        "-g1",
78    ],
79    include_dirs: [
80        "external/cronet/",
81        "external/cronet/buildtools/third_party/libc++/",
82        "external/cronet/third_party/brotli/include/",
83        "external/cronet/third_party/libc++/src/include",
84        "external/cronet/third_party/libc++abi/src/include",
85    ],
86    cpp_std: "c++20",
87    ldflags: [
88        "-Wl,--as-needed",
89        "-Wl,--gc-sections",
90        "-Wl,--icf=all",
91    ],
92    visibility: [
93        "//external/cronet:__subpackages__",
94    ],
95    target: {
96        android_arm: {
97            cflags: [
98                "-D_FORTIFY_SOURCE=2",
99            ],
100        },
101        android_arm64: {
102            cflags: [
103                "-D_FORTIFY_SOURCE=2",
104                "-O2",
105                "-mno-outline",
106            ],
107        },
108        android_x86: {
109            cflags: [
110                "-D_FORTIFY_SOURCE=2",
111                "-msse3",
112            ],
113        },
114        android_x86_64: {
115            cflags: [
116                "-D_FORTIFY_SOURCE=2",
117                "-msse3",
118            ],
119        },
120    },
121}
122
123// GN: //third_party/brotli:common__testing
124cc_library_static {
125    name: "cronet_aml_third_party_brotli_common__testing",
126    srcs: [
127        "common/constants.c",
128        "common/context.c",
129        "common/dictionary.c",
130        "common/platform.c",
131        "common/shared_dictionary.c",
132        "common/transform.c",
133    ],
134    defaults: [
135        "cronet_aml_cc_defaults",
136    ],
137    cflags: [
138        "-DANDROID",
139        "-DANDROID_NDK_VERSION_ROLL=r26b_1",
140        "-DCR_CLANG_REVISION=\"llvmorg-19-init-8091-gab037c4f-22\"",
141        "-DCR_LIBCXX_REVISION=e3b94d0e5b86883fd77696bf10dc33ba250ba99b",
142        "-DDYNAMIC_ANNOTATIONS_ENABLED=0",
143        "-DHAVE_SYS_UIO_H",
144        "-DNDEBUG",
145        "-DNO_UNWIND_TABLES",
146        "-DNVALGRIND",
147        "-DOFFICIAL_BUILD",
148        "-D_GNU_SOURCE",
149        "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
150        "-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE",
151        "-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
152        "-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__",
153        "-D__STDC_CONSTANT_MACROS",
154        "-D__STDC_FORMAT_MACROS",
155        "-fdata-sections",
156        "-ffunction-sections",
157        "-fno-asynchronous-unwind-tables",
158        "-fno-unwind-tables",
159        "-fstack-protector",
160        "-fvisibility-inlines-hidden",
161        "-fvisibility=hidden",
162        "-g1",
163    ],
164    include_dirs: [
165        "external/cronet/",
166        "external/cronet/buildtools/third_party/libc++/",
167        "external/cronet/third_party/brotli/include/",
168        "external/cronet/third_party/libc++/src/include",
169        "external/cronet/third_party/libc++abi/src/include",
170    ],
171    cpp_std: "c++20",
172    ldflags: [
173        "-Wl,--as-needed",
174        "-Wl,--gc-sections",
175        "-Wl,--icf=all",
176    ],
177    visibility: [
178        "//external/cronet:__subpackages__",
179    ],
180    target: {
181        android_arm: {
182            cflags: [
183                "-D_FORTIFY_SOURCE=2",
184            ],
185        },
186        android_arm64: {
187            cflags: [
188                "-D_FORTIFY_SOURCE=2",
189                "-O2",
190                "-mno-outline",
191            ],
192        },
193        android_x86: {
194            cflags: [
195                "-D_FORTIFY_SOURCE=2",
196                "-msse3",
197            ],
198        },
199        android_x86_64: {
200            cflags: [
201                "-D_FORTIFY_SOURCE=2",
202                "-msse3",
203            ],
204        },
205    },
206}
207
208// GN: //third_party/brotli:dec
209cc_library_static {
210    name: "cronet_aml_third_party_brotli_dec",
211    srcs: [
212        "dec/bit_reader.c",
213        "dec/decode.c",
214        "dec/huffman.c",
215        "dec/state.c",
216    ],
217    defaults: [
218        "cronet_aml_cc_defaults",
219    ],
220    cflags: [
221        "-DANDROID",
222        "-DANDROID_NDK_VERSION_ROLL=r26b_1",
223        "-DCR_CLANG_REVISION=\"llvmorg-19-init-8091-gab037c4f-22\"",
224        "-DCR_LIBCXX_REVISION=e3b94d0e5b86883fd77696bf10dc33ba250ba99b",
225        "-DDYNAMIC_ANNOTATIONS_ENABLED=0",
226        "-DHAVE_SYS_UIO_H",
227        "-DNDEBUG",
228        "-DNO_UNWIND_TABLES",
229        "-DNVALGRIND",
230        "-DOFFICIAL_BUILD",
231        "-D_GNU_SOURCE",
232        "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
233        "-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE",
234        "-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
235        "-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__",
236        "-O2",
237        "-fdata-sections",
238        "-ffunction-sections",
239        "-fno-asynchronous-unwind-tables",
240        "-fno-unwind-tables",
241        "-fstack-protector",
242        "-fvisibility-inlines-hidden",
243        "-fvisibility=hidden",
244        "-g1",
245    ],
246    include_dirs: [
247        "external/cronet/",
248        "external/cronet/buildtools/third_party/libc++/",
249        "external/cronet/third_party/brotli/include/",
250        "external/cronet/third_party/libc++/src/include",
251        "external/cronet/third_party/libc++abi/src/include",
252    ],
253    cpp_std: "c++20",
254    ldflags: [
255        "-Wl,--as-needed",
256        "-Wl,--gc-sections",
257        "-Wl,--icf=all",
258    ],
259    visibility: [
260        "//external/cronet:__subpackages__",
261    ],
262    target: {
263        android_arm64: {
264            cflags: [
265                "-mno-outline",
266            ],
267        },
268        android_x86: {
269            cflags: [
270                "-msse3",
271            ],
272        },
273        android_x86_64: {
274            cflags: [
275                "-msse3",
276            ],
277        },
278    },
279}
280
281// GN: //third_party/brotli:dec__testing
282cc_library_static {
283    name: "cronet_aml_third_party_brotli_dec__testing",
284    srcs: [
285        "dec/bit_reader.c",
286        "dec/decode.c",
287        "dec/huffman.c",
288        "dec/state.c",
289    ],
290    defaults: [
291        "cronet_aml_cc_defaults",
292    ],
293    cflags: [
294        "-DANDROID",
295        "-DANDROID_NDK_VERSION_ROLL=r26b_1",
296        "-DCR_CLANG_REVISION=\"llvmorg-19-init-8091-gab037c4f-22\"",
297        "-DCR_LIBCXX_REVISION=e3b94d0e5b86883fd77696bf10dc33ba250ba99b",
298        "-DDYNAMIC_ANNOTATIONS_ENABLED=0",
299        "-DHAVE_SYS_UIO_H",
300        "-DNDEBUG",
301        "-DNO_UNWIND_TABLES",
302        "-DNVALGRIND",
303        "-DOFFICIAL_BUILD",
304        "-D_GNU_SOURCE",
305        "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
306        "-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE",
307        "-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
308        "-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__",
309        "-O2",
310        "-fdata-sections",
311        "-ffunction-sections",
312        "-fno-asynchronous-unwind-tables",
313        "-fno-unwind-tables",
314        "-fstack-protector",
315        "-fvisibility-inlines-hidden",
316        "-fvisibility=hidden",
317        "-g1",
318    ],
319    include_dirs: [
320        "external/cronet/",
321        "external/cronet/buildtools/third_party/libc++/",
322        "external/cronet/third_party/brotli/include/",
323        "external/cronet/third_party/libc++/src/include",
324        "external/cronet/third_party/libc++abi/src/include",
325    ],
326    cpp_std: "c++20",
327    ldflags: [
328        "-Wl,--as-needed",
329        "-Wl,--gc-sections",
330        "-Wl,--icf=all",
331    ],
332    visibility: [
333        "//external/cronet:__subpackages__",
334    ],
335    target: {
336        android_arm64: {
337            cflags: [
338                "-mno-outline",
339            ],
340        },
341        android_x86: {
342            cflags: [
343                "-msse3",
344            ],
345        },
346        android_x86_64: {
347            cflags: [
348                "-msse3",
349            ],
350        },
351    },
352}
353