xref: /aosp_15_r20/external/cronet/third_party/libevent/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_libevent_license",
21    ],
22}
23
24// GN: License-Artificial
25license {
26    name: "external_cronet_third_party_libevent_license",
27    visibility: [
28        ":__subpackages__",
29    ],
30    license_text: [
31        "LICENSE",
32    ],
33    license_kinds: [
34        "SPDX-license-identifier-BSD",
35    ],
36}
37
38// GN: //third_party/libevent:libevent
39cc_library_static {
40    name: "cronet_aml_third_party_libevent_libevent",
41    srcs: [
42        "epoll.c",
43        "event.c",
44        "evutil.c",
45        "log.c",
46        "poll.c",
47        "select.c",
48        "signal.c",
49        "strlcpy.c",
50    ],
51    defaults: [
52        "cronet_aml_cc_defaults",
53    ],
54    cflags: [
55        "-DANDROID",
56        "-DANDROID_NDK_VERSION_ROLL=r26b_1",
57        "-DCR_CLANG_REVISION=\"llvmorg-19-init-8091-gab037c4f-22\"",
58        "-DCR_LIBCXX_REVISION=e3b94d0e5b86883fd77696bf10dc33ba250ba99b",
59        "-DDYNAMIC_ANNOTATIONS_ENABLED=0",
60        "-DHAVE_CONFIG_H",
61        "-DHAVE_SYS_UIO_H",
62        "-DNDEBUG",
63        "-DNO_UNWIND_TABLES",
64        "-DNVALGRIND",
65        "-DOFFICIAL_BUILD",
66        "-D_GNU_SOURCE",
67        "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
68        "-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE",
69        "-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
70        "-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__",
71        "-O2",
72        "-fdata-sections",
73        "-ffunction-sections",
74        "-fno-asynchronous-unwind-tables",
75        "-fno-unwind-tables",
76        "-fstack-protector",
77        "-fvisibility-inlines-hidden",
78        "-fvisibility=hidden",
79        "-g1",
80    ],
81    include_dirs: [
82        "external/cronet/",
83        "external/cronet/buildtools/third_party/libc++/",
84        "external/cronet/third_party/libc++/src/include",
85        "external/cronet/third_party/libc++abi/src/include",
86        "external/cronet/third_party/libevent/android/",
87        "external/cronet/third_party/libevent/compat/",
88    ],
89    cpp_std: "c++20",
90    ldflags: [
91        "-Wl,--as-needed",
92        "-Wl,--gc-sections",
93        "-Wl,--icf=all",
94    ],
95    visibility: [
96        "//external/cronet:__subpackages__",
97    ],
98    target: {
99        android_arm64: {
100            cflags: [
101                "-mno-outline",
102            ],
103        },
104        android_x86: {
105            cflags: [
106                "-msse3",
107            ],
108        },
109        android_x86_64: {
110            cflags: [
111                "-msse3",
112            ],
113        },
114    },
115}
116
117// GN: //third_party/libevent:libevent__testing
118cc_library_static {
119    name: "cronet_aml_third_party_libevent_libevent__testing",
120    srcs: [
121        "epoll.c",
122        "event.c",
123        "evutil.c",
124        "log.c",
125        "poll.c",
126        "select.c",
127        "signal.c",
128        "strlcpy.c",
129    ],
130    host_supported: true,
131    defaults: [
132        "cronet_aml_cc_defaults",
133    ],
134    cflags: [
135        "-DCR_CLANG_REVISION=\"llvmorg-19-init-8091-gab037c4f-22\"",
136        "-DCR_LIBCXX_REVISION=e3b94d0e5b86883fd77696bf10dc33ba250ba99b",
137        "-DDYNAMIC_ANNOTATIONS_ENABLED=0",
138        "-DHAVE_CONFIG_H",
139        "-DNDEBUG",
140        "-DNO_UNWIND_TABLES",
141        "-DNVALGRIND",
142        "-DOFFICIAL_BUILD",
143        "-D_GNU_SOURCE",
144        "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
145        "-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE",
146        "-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
147        "-O2",
148        "-fdata-sections",
149        "-ffunction-sections",
150        "-fno-asynchronous-unwind-tables",
151        "-fno-unwind-tables",
152        "-fstack-protector",
153        "-fvisibility-inlines-hidden",
154        "-fvisibility=hidden",
155        "-g1",
156    ],
157    include_dirs: [
158        "external/cronet/",
159        "external/cronet/buildtools/third_party/libc++/",
160        "external/cronet/third_party/libc++/src/include",
161        "external/cronet/third_party/libc++abi/src/include",
162        "external/cronet/third_party/libevent/compat/",
163    ],
164    cpp_std: "c++20",
165    ldflags: [
166        "-Wl,--as-needed",
167        "-Wl,--gc-sections",
168        "-Wl,--icf=all",
169    ],
170    visibility: [
171        "//external/cronet:__subpackages__",
172    ],
173    target: {
174        android_arm: {
175            cflags: [
176                "-DANDROID",
177                "-DANDROID_NDK_VERSION_ROLL=r26b_1",
178                "-DHAVE_SYS_UIO_H",
179                "-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__",
180            ],
181            include_dirs: [
182                "external/cronet/third_party/libevent/android/",
183            ],
184        },
185        android_arm64: {
186            cflags: [
187                "-DANDROID",
188                "-DANDROID_NDK_VERSION_ROLL=r26b_1",
189                "-DHAVE_SYS_UIO_H",
190                "-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__",
191                "-mno-outline",
192            ],
193            include_dirs: [
194                "external/cronet/third_party/libevent/android/",
195            ],
196        },
197        android_riscv64: {
198            cflags: [
199                "-DANDROID",
200                "-DANDROID_NDK_VERSION_ROLL=r26b_1",
201                "-DHAVE_SYS_UIO_H",
202                "-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__",
203            ],
204            include_dirs: [
205                "external/cronet/third_party/libevent/android/",
206            ],
207        },
208        android_x86: {
209            cflags: [
210                "-DANDROID",
211                "-DANDROID_NDK_VERSION_ROLL=r26b_1",
212                "-DHAVE_SYS_UIO_H",
213                "-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__",
214                "-msse3",
215            ],
216            include_dirs: [
217                "external/cronet/third_party/libevent/android/",
218            ],
219        },
220        android_x86_64: {
221            cflags: [
222                "-DANDROID",
223                "-DANDROID_NDK_VERSION_ROLL=r26b_1",
224                "-DHAVE_SYS_UIO_H",
225                "-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__",
226                "-msse3",
227            ],
228            include_dirs: [
229                "external/cronet/third_party/libevent/android/",
230            ],
231        },
232        host: {
233            cflags: [
234                "-DCR_SYSROOT_KEY=20230611T210420Z-2",
235                "-DUSE_AURA=1",
236                "-DUSE_OZONE=1",
237                "-DUSE_UDEV",
238                "-D_FILE_OFFSET_BITS=64",
239                "-D_LARGEFILE64_SOURCE",
240                "-D_LARGEFILE_SOURCE",
241                "-msse3",
242            ],
243            include_dirs: [
244                "external/cronet/third_party/libevent/linux/",
245            ],
246            compile_multilib: "64",
247        },
248    },
249}
250