Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 1 | // 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 Badour | 7c55f9e | 2021-02-12 15:50:24 -0800 | [diff] [blame] | 16 | package { |
| 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 |
| 34 | license { |
| 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 Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 54 | libwebsocketsSrcFiles = [ |
| 55 | "lib/core-net/adopt.c", |
Jorge E. Moreira | 4d0db3e | 2021-12-23 11:10:24 -0800 | [diff] [blame] | 56 | "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 Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 63 | "lib/core-net/close.c", |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 64 | "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 Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 68 | "lib/core-net/service.c", |
| 69 | "lib/core-net/sorted-usec-list.c", |
| 70 | "lib/core-net/state.c", |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 71 | "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. Moreira | 4d0db3e | 2021-12-23 11:10:24 -0800 | [diff] [blame] | 80 | "lib/core/lws_map.c", |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 81 | "lib/core/vfs.c", |
| 82 | "lib/event-libs/poll/poll.c", |
| 83 | "lib/misc/base64-decode.c", |
Jorge E. Moreira | 4d0db3e | 2021-12-23 11:10:24 -0800 | [diff] [blame] | 84 | "lib/misc/cache-ttl/file.c", |
| 85 | "lib/misc/cache-ttl/heap.c", |
| 86 | "lib/misc/cache-ttl/lws-cache-ttl.c", |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 87 | "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. Moreira | 4d0db3e | 2021-12-23 11:10:24 -0800 | [diff] [blame] | 92 | "lib/misc/prng.c", |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 93 | "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 Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 106 | "lib/roles/http/client/client-http.c", |
Jorge E. Moreira | 4d0db3e | 2021-12-23 11:10:24 -0800 | [diff] [blame] | 107 | "lib/roles/http/cookie.c", |
| 108 | "lib/roles/http/date.c", |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 109 | "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. Moreira | 4d0db3e | 2021-12-23 11:10:24 -0800 | [diff] [blame] | 122 | "lib/system/smd/smd.c", |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 123 | "lib/system/system.c", |
| 124 | "lib/tls/openssl/openssl-client.c", |
| 125 | "lib/tls/openssl/openssl-server.c", |
Jorge E. Moreira | 4d0db3e | 2021-12-23 11:10:24 -0800 | [diff] [blame] | 126 | "lib/tls/openssl/openssl-session.c", |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 127 | "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. Moreira | 4d0db3e | 2021-12-23 11:10:24 -0800 | [diff] [blame] | 133 | "lib/tls/tls-sessions.c", |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 134 | "lib/tls/tls.c", |
| 135 | ] |
| 136 | |
| 137 | libwebsocketsIncludePath = [ |
| 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. Moreira | 4d0db3e | 2021-12-23 11:10:24 -0800 | [diff] [blame] | 164 | "lib/system/smd", |
| 165 | "lib/system/metrics", |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 166 | "lib/roles/mqtt", |
| 167 | "lib/plat/unix", |
| 168 | "lib", |
| 169 | ] |
| 170 | |
| 171 | cc_library_static { |
| 172 | name: "libwebsockets", |
| 173 | srcs: libwebsocketsSrcFiles, |
| 174 | local_include_dirs: libwebsocketsIncludePath, |
| 175 | export_include_dirs: ["include"], |
Yifan Hong | f239200 | 2021-04-07 16:23:03 -0700 | [diff] [blame] | 176 | static_libs: [ |
| 177 | "libssl", |
| 178 | "libcap", |
| 179 | ], |
Jorge E. Moreira | 4d0db3e | 2021-12-23 11:10:24 -0800 | [diff] [blame] | 180 | c_std: "gnu17", |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 181 | host_supported: true, |
Yifan Hong | 6b7c9eb | 2021-04-07 17:38:14 -0700 | [diff] [blame] | 182 | product_variables: { |
| 183 | debuggable: { |
| 184 | cflags: [ |
| 185 | "-UNDEBUG", |
| 186 | ], |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 187 | }, |
Yifan Hong | 6b7c9eb | 2021-04-07 17:38:14 -0700 | [diff] [blame] | 188 | }, |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 189 | target: { |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 190 | darwin: { |
| 191 | enabled: false, |
| 192 | }, |
Yifan Hong | f239200 | 2021-04-07 16:23:03 -0700 | [diff] [blame] | 193 | android: { |
| 194 | shared_libs: [ |
| 195 | "libcrypto", |
| 196 | ], |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 197 | cflags: [ |
Yifan Hong | f239200 | 2021-04-07 16:23:03 -0700 | [diff] [blame] | 198 | "-Wno-unused-parameter", |
| 199 | "-Wno-missing-field-initializers", |
| 200 | ], |
| 201 | }, |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 202 | host: { |
Yifan Hong | f239200 | 2021-04-07 16:23:03 -0700 | [diff] [blame] | 203 | static_libs: [ |
| 204 | "libcrypto", |
| 205 | ], |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 206 | cflags: [ |
Yifan Hong | 6b7c9eb | 2021-04-07 17:38:14 -0700 | [diff] [blame] | 207 | "-UNDEBUG", |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 208 | "-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 Cross | a2b8761 | 2020-11-10 15:01:03 -0800 | [diff] [blame] | 219 | "-Wno-unused-command-line-argument", |
| 220 | "-Wno-unused-parameter", |
| 221 | "-Wno-implicit-function-declaration", |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 222 | ], |
| 223 | }, |
| 224 | }, |
| 225 | } |