blob: 900bbfaa6f1807c9b7889240e755ede9323a31f3 [file] [log] [blame]
Steve Kim6379e252020-04-08 14:45:01 -07001// Copyright (C) 2020 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// Common variables.
Bob Badour7c55f9e2021-02-12 15:50:24 -080016package {
17 default_applicable_licenses: ["external_libwebsockets_license"],
18}
19
20// Added automatically by a large-scale-change that took the approach of
21// 'apply every license found to every target'. While this makes sure we respect
22// every license restriction, it may not be entirely correct.
23//
24// e.g. GPL in an MIT project might only apply to the contrib/ directory.
25//
26// Please consider splitting the single license below into multiple licenses,
27// taking care not to lose any license_kind information, and overriding the
28// default license using the 'licenses: [...]' property on targets as needed.
29//
30// For unused files, consider creating a 'fileGroup' with "//visibility:private"
31// to attach the license to, and including a comment whether the files may be
32// used in the current project.
33// See: http://go/android-license-faq
34license {
35 name: "external_libwebsockets_license",
36 visibility: [":__subpackages__"],
37 license_kinds: [
38 "SPDX-license-identifier-Apache-2.0",
39 "SPDX-license-identifier-BSD",
40 "SPDX-license-identifier-Beerware",
41 "SPDX-license-identifier-CC0-1.0",
42 "SPDX-license-identifier-GPL",
43 "SPDX-license-identifier-LGPL",
44 "SPDX-license-identifier-MIT",
45 "SPDX-license-identifier-Zlib",
46 "legacy_permissive",
47 "legacy_unencumbered",
48 ],
49 license_text: [
50 "LICENSE",
51 ],
52}
53
Steve Kim6379e252020-04-08 14:45:01 -070054libwebsocketsSrcFiles = [
55 "lib/core-net/adopt.c",
Jorge E. Moreira4d0db3e2021-12-23 11:10:24 -080056 "lib/core-net/client/client.c",
57 "lib/core-net/client/conmon.c",
58 "lib/core-net/client/connect.c",
59 "lib/core-net/client/connect2.c",
60 "lib/core-net/client/connect3.c",
61 "lib/core-net/client/connect4.c",
62 "lib/core-net/client/sort-dns.c",
Steve Kim6379e252020-04-08 14:45:01 -070063 "lib/core-net/close.c",
Steve Kim6379e252020-04-08 14:45:01 -070064 "lib/core-net/dummy-callback.c",
65 "lib/core-net/network.c",
66 "lib/core-net/output.c",
67 "lib/core-net/pollfd.c",
Steve Kim6379e252020-04-08 14:45:01 -070068 "lib/core-net/service.c",
69 "lib/core-net/sorted-usec-list.c",
70 "lib/core-net/state.c",
Steve Kim6379e252020-04-08 14:45:01 -070071 "lib/core-net/vhost.c",
72 "lib/core-net/wsi-timeout.c",
73 "lib/core-net/wsi.c",
74 "lib/core/alloc.c",
75 "lib/core/buflist.c",
76 "lib/core/context.c",
77 "lib/core/libwebsockets.c",
78 "lib/core/logs.c",
79 "lib/core/lws_dll2.c",
Jorge E. Moreira4d0db3e2021-12-23 11:10:24 -080080 "lib/core/lws_map.c",
Steve Kim6379e252020-04-08 14:45:01 -070081 "lib/core/vfs.c",
82 "lib/event-libs/poll/poll.c",
83 "lib/misc/base64-decode.c",
Jorge E. Moreira4d0db3e2021-12-23 11:10:24 -080084 "lib/misc/cache-ttl/file.c",
85 "lib/misc/cache-ttl/heap.c",
86 "lib/misc/cache-ttl/lws-cache-ttl.c",
Steve Kim6379e252020-04-08 14:45:01 -070087 "lib/misc/dir.c",
88 "lib/misc/lejp.c",
89 "lib/misc/lws-ring.c",
90 "lib/misc/lwsac/cached-file.c",
91 "lib/misc/lwsac/lwsac.c",
Jorge E. Moreira4d0db3e2021-12-23 11:10:24 -080092 "lib/misc/prng.c",
Steve Kim6379e252020-04-08 14:45:01 -070093 "lib/misc/sha-1.c",
94 "lib/plat/unix/unix-caps.c",
95 "lib/plat/unix/unix-fds.c",
96 "lib/plat/unix/unix-file.c",
97 "lib/plat/unix/unix-init.c",
98 "lib/plat/unix/unix-misc.c",
99 "lib/plat/unix/unix-pipe.c",
100 "lib/plat/unix/unix-service.c",
101 "lib/plat/unix/unix-sockets.c",
102 "lib/roles/h1/ops-h1.c",
103 "lib/roles/h2/hpack.c",
104 "lib/roles/h2/http2.c",
105 "lib/roles/h2/ops-h2.c",
Steve Kim6379e252020-04-08 14:45:01 -0700106 "lib/roles/http/client/client-http.c",
Jorge E. Moreira4d0db3e2021-12-23 11:10:24 -0800107 "lib/roles/http/cookie.c",
108 "lib/roles/http/date.c",
Steve Kim6379e252020-04-08 14:45:01 -0700109 "lib/roles/http/header.c",
110 "lib/roles/http/parsers.c",
111 "lib/roles/http/server/lejp-conf.c",
112 "lib/roles/http/server/lws-spa.c",
113 "lib/roles/http/server/server.c",
114 "lib/roles/listen/ops-listen.c",
115 "lib/roles/pipe/ops-pipe.c",
116 "lib/roles/raw-file/ops-raw-file.c",
117 "lib/roles/raw-skt/ops-raw-skt.c",
118 "lib/roles/ws/client-parser-ws.c",
119 "lib/roles/ws/client-ws.c",
120 "lib/roles/ws/ops-ws.c",
121 "lib/roles/ws/server-ws.c",
Jorge E. Moreira4d0db3e2021-12-23 11:10:24 -0800122 "lib/system/smd/smd.c",
Steve Kim6379e252020-04-08 14:45:01 -0700123 "lib/system/system.c",
124 "lib/tls/openssl/openssl-client.c",
125 "lib/tls/openssl/openssl-server.c",
Jorge E. Moreira4d0db3e2021-12-23 11:10:24 -0800126 "lib/tls/openssl/openssl-session.c",
Steve Kim6379e252020-04-08 14:45:01 -0700127 "lib/tls/openssl/openssl-ssl.c",
128 "lib/tls/openssl/openssl-tls.c",
129 "lib/tls/openssl/openssl-x509.c",
130 "lib/tls/tls-client.c",
131 "lib/tls/tls-network.c",
132 "lib/tls/tls-server.c",
Jorge E. Moreira4d0db3e2021-12-23 11:10:24 -0800133 "lib/tls/tls-sessions.c",
Steve Kim6379e252020-04-08 14:45:01 -0700134 "lib/tls/tls.c",
135]
136
137libwebsocketsIncludePath = [
138 "plugins",
139 "lib/core",
140 "lib/core-net",
141 "lib/event-libs",
142 "lib/abstract",
143 "lib/tls",
144 "lib/roles",
145 "lib/event-libs/libuv",
146 "lib/event-libs/poll",
147 "lib/event-libs/libevent",
148 "lib/event-libs/glib",
149 "lib/event-libs/libev",
150 "lib/jose/jwe",
151 "lib/jose/jws",
152 "lib/jose",
153 "lib/misc",
154 "lib/roles/http",
155 "lib/roles/http/compression",
156 "lib/roles/h1",
157 "lib/roles/h2",
158 "lib/roles/ws",
159 "lib/roles/cgi",
160 "lib/roles/dbus",
161 "lib/roles/raw-proxy",
162 "lib/abstract",
163 "lib/system/async-dns",
Jorge E. Moreira4d0db3e2021-12-23 11:10:24 -0800164 "lib/system/smd",
165 "lib/system/metrics",
Steve Kim6379e252020-04-08 14:45:01 -0700166 "lib/roles/mqtt",
167 "lib/plat/unix",
168 "lib",
169]
170
171cc_library_static {
172 name: "libwebsockets",
173 srcs: libwebsocketsSrcFiles,
174 local_include_dirs: libwebsocketsIncludePath,
175 export_include_dirs: ["include"],
Yifan Hongf2392002021-04-07 16:23:03 -0700176 static_libs: [
177 "libssl",
178 "libcap",
179 ],
Jorge E. Moreira4d0db3e2021-12-23 11:10:24 -0800180 c_std: "gnu17",
Steve Kim6379e252020-04-08 14:45:01 -0700181 host_supported: true,
Yifan Hong6b7c9eb2021-04-07 17:38:14 -0700182 product_variables: {
183 debuggable: {
184 cflags: [
185 "-UNDEBUG",
186 ],
Steve Kim6379e252020-04-08 14:45:01 -0700187 },
Yifan Hong6b7c9eb2021-04-07 17:38:14 -0700188 },
Steve Kim6379e252020-04-08 14:45:01 -0700189 target: {
Steve Kim6379e252020-04-08 14:45:01 -0700190 darwin: {
191 enabled: false,
192 },
Yifan Hongf2392002021-04-07 16:23:03 -0700193 android: {
194 shared_libs: [
195 "libcrypto",
196 ],
Steve Kim6379e252020-04-08 14:45:01 -0700197 cflags: [
Yifan Hongf2392002021-04-07 16:23:03 -0700198 "-Wno-unused-parameter",
199 "-Wno-missing-field-initializers",
200 ],
201 },
Steve Kim6379e252020-04-08 14:45:01 -0700202 host: {
Yifan Hongf2392002021-04-07 16:23:03 -0700203 static_libs: [
204 "libcrypto",
205 ],
Steve Kim6379e252020-04-08 14:45:01 -0700206 cflags: [
Yifan Hong6b7c9eb2021-04-07 17:38:14 -0700207 "-UNDEBUG",
Steve Kim6379e252020-04-08 14:45:01 -0700208 "-Wall",
209 "-Wsign-compare",
210 "-Wstrict-aliasing",
211 "-Wuninitialized",
212 "-Werror",
213 "-fvisibility=hidden",
214 "-Wundef",
215 "-Wtype-limits",
216 "-Wignored-qualifiers",
217 "-Wno-deprecated-declarations",
218 "-pthread",
Colin Crossa2b87612020-11-10 15:01:03 -0800219 "-Wno-unused-command-line-argument",
220 "-Wno-unused-parameter",
221 "-Wno-implicit-function-declaration",
Steve Kim6379e252020-04-08 14:45:01 -0700222 ],
223 },
224 },
225}