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", |
| 56 | "lib/core-net/client.c", |
| 57 | "lib/core-net/close.c", |
| 58 | "lib/core-net/connect.c", |
| 59 | "lib/core-net/dummy-callback.c", |
| 60 | "lib/core-net/network.c", |
| 61 | "lib/core-net/output.c", |
| 62 | "lib/core-net/pollfd.c", |
| 63 | "lib/core-net/sequencer.c", |
| 64 | "lib/core-net/server.c", |
| 65 | "lib/core-net/service.c", |
| 66 | "lib/core-net/sorted-usec-list.c", |
| 67 | "lib/core-net/state.c", |
| 68 | "lib/core-net/stats.c", |
| 69 | "lib/core-net/vhost.c", |
| 70 | "lib/core-net/wsi-timeout.c", |
| 71 | "lib/core-net/wsi.c", |
| 72 | "lib/core/alloc.c", |
| 73 | "lib/core/buflist.c", |
| 74 | "lib/core/context.c", |
| 75 | "lib/core/libwebsockets.c", |
| 76 | "lib/core/logs.c", |
| 77 | "lib/core/lws_dll2.c", |
| 78 | "lib/core/vfs.c", |
| 79 | "lib/event-libs/poll/poll.c", |
| 80 | "lib/misc/base64-decode.c", |
| 81 | "lib/misc/dir.c", |
| 82 | "lib/misc/lejp.c", |
| 83 | "lib/misc/lws-ring.c", |
| 84 | "lib/misc/lwsac/cached-file.c", |
| 85 | "lib/misc/lwsac/lwsac.c", |
| 86 | "lib/misc/sha-1.c", |
| 87 | "lib/plat/unix/unix-caps.c", |
| 88 | "lib/plat/unix/unix-fds.c", |
| 89 | "lib/plat/unix/unix-file.c", |
| 90 | "lib/plat/unix/unix-init.c", |
| 91 | "lib/plat/unix/unix-misc.c", |
| 92 | "lib/plat/unix/unix-pipe.c", |
| 93 | "lib/plat/unix/unix-service.c", |
| 94 | "lib/plat/unix/unix-sockets.c", |
| 95 | "lib/roles/h1/ops-h1.c", |
| 96 | "lib/roles/h2/hpack.c", |
| 97 | "lib/roles/h2/http2.c", |
| 98 | "lib/roles/h2/ops-h2.c", |
| 99 | "lib/roles/http/client/client-handshake.c", |
| 100 | "lib/roles/http/client/client-http.c", |
| 101 | "lib/roles/http/header.c", |
| 102 | "lib/roles/http/parsers.c", |
| 103 | "lib/roles/http/server/lejp-conf.c", |
| 104 | "lib/roles/http/server/lws-spa.c", |
| 105 | "lib/roles/http/server/server.c", |
| 106 | "lib/roles/listen/ops-listen.c", |
| 107 | "lib/roles/pipe/ops-pipe.c", |
| 108 | "lib/roles/raw-file/ops-raw-file.c", |
| 109 | "lib/roles/raw-skt/ops-raw-skt.c", |
| 110 | "lib/roles/ws/client-parser-ws.c", |
| 111 | "lib/roles/ws/client-ws.c", |
| 112 | "lib/roles/ws/ops-ws.c", |
| 113 | "lib/roles/ws/server-ws.c", |
| 114 | "lib/system/system.c", |
| 115 | "lib/tls/openssl/openssl-client.c", |
| 116 | "lib/tls/openssl/openssl-server.c", |
| 117 | "lib/tls/openssl/openssl-ssl.c", |
| 118 | "lib/tls/openssl/openssl-tls.c", |
| 119 | "lib/tls/openssl/openssl-x509.c", |
| 120 | "lib/tls/tls-client.c", |
| 121 | "lib/tls/tls-network.c", |
| 122 | "lib/tls/tls-server.c", |
| 123 | "lib/tls/tls.c", |
| 124 | ] |
| 125 | |
| 126 | libwebsocketsIncludePath = [ |
| 127 | "plugins", |
| 128 | "lib/core", |
| 129 | "lib/core-net", |
| 130 | "lib/event-libs", |
| 131 | "lib/abstract", |
| 132 | "lib/tls", |
| 133 | "lib/roles", |
| 134 | "lib/event-libs/libuv", |
| 135 | "lib/event-libs/poll", |
| 136 | "lib/event-libs/libevent", |
| 137 | "lib/event-libs/glib", |
| 138 | "lib/event-libs/libev", |
| 139 | "lib/jose/jwe", |
| 140 | "lib/jose/jws", |
| 141 | "lib/jose", |
| 142 | "lib/misc", |
| 143 | "lib/roles/http", |
| 144 | "lib/roles/http/compression", |
| 145 | "lib/roles/h1", |
| 146 | "lib/roles/h2", |
| 147 | "lib/roles/ws", |
| 148 | "lib/roles/cgi", |
| 149 | "lib/roles/dbus", |
| 150 | "lib/roles/raw-proxy", |
| 151 | "lib/abstract", |
| 152 | "lib/system/async-dns", |
| 153 | "lib/roles/mqtt", |
| 154 | "lib/plat/unix", |
| 155 | "lib", |
| 156 | ] |
| 157 | |
| 158 | cc_library_static { |
| 159 | name: "libwebsockets", |
| 160 | srcs: libwebsocketsSrcFiles, |
| 161 | local_include_dirs: libwebsocketsIncludePath, |
| 162 | export_include_dirs: ["include"], |
Yifan Hong | f239200 | 2021-04-07 16:23:03 -0700 | [diff] [blame] | 163 | static_libs: [ |
| 164 | "libssl", |
| 165 | "libcap", |
| 166 | ], |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 167 | host_supported: true, |
Yifan Hong | 6b7c9eb | 2021-04-07 17:38:14 -0700 | [diff] [blame] | 168 | product_variables: { |
| 169 | debuggable: { |
| 170 | cflags: [ |
| 171 | "-UNDEBUG", |
| 172 | ], |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 173 | }, |
Yifan Hong | 6b7c9eb | 2021-04-07 17:38:14 -0700 | [diff] [blame] | 174 | }, |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 175 | target: { |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 176 | darwin: { |
| 177 | enabled: false, |
| 178 | }, |
Yifan Hong | f239200 | 2021-04-07 16:23:03 -0700 | [diff] [blame] | 179 | android: { |
| 180 | shared_libs: [ |
| 181 | "libcrypto", |
| 182 | ], |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 183 | cflags: [ |
Yifan Hong | f239200 | 2021-04-07 16:23:03 -0700 | [diff] [blame] | 184 | "-Wno-unused-parameter", |
| 185 | "-Wno-missing-field-initializers", |
| 186 | ], |
| 187 | }, |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 188 | host: { |
Yifan Hong | f239200 | 2021-04-07 16:23:03 -0700 | [diff] [blame] | 189 | static_libs: [ |
| 190 | "libcrypto", |
| 191 | ], |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 192 | cflags: [ |
Yifan Hong | 6b7c9eb | 2021-04-07 17:38:14 -0700 | [diff] [blame] | 193 | "-UNDEBUG", |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 194 | "-Wall", |
| 195 | "-Wsign-compare", |
| 196 | "-Wstrict-aliasing", |
| 197 | "-Wuninitialized", |
| 198 | "-Werror", |
| 199 | "-fvisibility=hidden", |
| 200 | "-Wundef", |
| 201 | "-Wtype-limits", |
| 202 | "-Wignored-qualifiers", |
| 203 | "-Wno-deprecated-declarations", |
| 204 | "-pthread", |
Colin Cross | a2b8761 | 2020-11-10 15:01:03 -0800 | [diff] [blame] | 205 | "-Wno-unused-command-line-argument", |
| 206 | "-Wno-unused-parameter", |
| 207 | "-Wno-implicit-function-declaration", |
Steve Kim | 6379e25 | 2020-04-08 14:45:01 -0700 | [diff] [blame] | 208 | ], |
| 209 | }, |
| 210 | }, |
| 211 | } |