// Copyright (C) 2020 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Common variables. package { default_applicable_licenses: ["external_libwebsockets_license"], } // Added automatically by a large-scale-change that took the approach of // 'apply every license found to every target'. While this makes sure we respect // every license restriction, it may not be entirely correct. // // e.g. GPL in an MIT project might only apply to the contrib/ directory. // // Please consider splitting the single license below into multiple licenses, // taking care not to lose any license_kind information, and overriding the // default license using the 'licenses: [...]' property on targets as needed. // // For unused files, consider creating a 'fileGroup' with "//visibility:private" // to attach the license to, and including a comment whether the files may be // used in the current project. // See: http://go/android-license-faq license { name: "external_libwebsockets_license", visibility: [":__subpackages__"], license_kinds: [ "SPDX-license-identifier-Apache-2.0", "SPDX-license-identifier-BSD", "SPDX-license-identifier-Beerware", "SPDX-license-identifier-CC0-1.0", "SPDX-license-identifier-GPL", "SPDX-license-identifier-LGPL", "SPDX-license-identifier-MIT", "SPDX-license-identifier-Zlib", "legacy_permissive", "legacy_unencumbered", ], license_text: [ "LICENSE", ], } libwebsocketsSrcFiles = [ "lib/core-net/adopt.c", "lib/core-net/client/client.c", "lib/core-net/client/conmon.c", "lib/core-net/client/connect.c", "lib/core-net/client/connect2.c", "lib/core-net/client/connect3.c", "lib/core-net/client/connect4.c", "lib/core-net/client/sort-dns.c", "lib/core-net/close.c", "lib/core-net/dummy-callback.c", "lib/core-net/network.c", "lib/core-net/output.c", "lib/core-net/pollfd.c", "lib/core-net/route.c", "lib/core-net/service.c", "lib/core-net/sorted-usec-list.c", "lib/core-net/state.c", "lib/core-net/vhost.c", "lib/core-net/wsi-timeout.c", "lib/core-net/wsi.c", "lib/core/alloc.c", "lib/core/buflist.c", "lib/core/context.c", "lib/core/libwebsockets.c", "lib/core/logs.c", "lib/core/lws_dll2.c", "lib/core/lws_map.c", "lib/core/vfs.c", "lib/event-libs/poll/poll.c", "lib/misc/base64-decode.c", "lib/misc/cache-ttl/file.c", "lib/misc/cache-ttl/heap.c", "lib/misc/cache-ttl/lws-cache-ttl.c", "lib/misc/dir.c", "lib/misc/lejp.c", "lib/misc/lws-ring.c", "lib/misc/lwsac/cached-file.c", "lib/misc/lwsac/lwsac.c", "lib/misc/prng.c", "lib/misc/sha-1.c", "lib/plat/unix/unix-caps.c", "lib/plat/unix/unix-fds.c", "lib/plat/unix/unix-file.c", "lib/plat/unix/unix-init.c", "lib/plat/unix/unix-misc.c", "lib/plat/unix/unix-pipe.c", "lib/plat/unix/unix-service.c", "lib/plat/unix/unix-sockets.c", "lib/roles/h1/ops-h1.c", "lib/roles/h2/hpack.c", "lib/roles/h2/http2.c", "lib/roles/h2/ops-h2.c", "lib/roles/http/client/client-http.c", "lib/roles/http/cookie.c", "lib/roles/http/date.c", "lib/roles/http/header.c", "lib/roles/http/parsers.c", "lib/roles/http/server/lejp-conf.c", "lib/roles/http/server/lws-spa.c", "lib/roles/http/server/server.c", "lib/roles/listen/ops-listen.c", "lib/roles/netlink/ops-netlink.c", "lib/roles/pipe/ops-pipe.c", "lib/roles/raw-file/ops-raw-file.c", "lib/roles/raw-skt/ops-raw-skt.c", "lib/roles/ws/client-parser-ws.c", "lib/roles/ws/client-ws.c", "lib/roles/ws/ops-ws.c", "lib/roles/ws/server-ws.c", "lib/system/smd/smd.c", "lib/system/system.c", "lib/tls/openssl/openssl-client.c", "lib/tls/openssl/openssl-server.c", "lib/tls/openssl/openssl-session.c", "lib/tls/openssl/openssl-ssl.c", "lib/tls/openssl/openssl-tls.c", "lib/tls/openssl/openssl-x509.c", "lib/tls/tls-client.c", "lib/tls/tls-network.c", "lib/tls/tls-server.c", "lib/tls/tls-sessions.c", "lib/tls/tls.c", ] libwebsocketsIncludePath = [ "plugins", "lib/core", "lib/core-net", "lib/event-libs", "lib/abstract", "lib/tls", "lib/roles", "lib/event-libs/libuv", "lib/event-libs/poll", "lib/event-libs/libevent", "lib/event-libs/glib", "lib/event-libs/libev", "lib/jose/jwe", "lib/jose/jws", "lib/jose", "lib/misc", "lib/roles/http", "lib/roles/http/compression", "lib/roles/h1", "lib/roles/h2", "lib/roles/ws", "lib/roles/cgi", "lib/roles/dbus", "lib/roles/raw-proxy", "lib/abstract", "lib/system/async-dns", "lib/system/smd", "lib/system/metrics", "lib/roles/mqtt", "lib/plat/unix", "lib", ] cc_library_static { name: "libwebsockets", srcs: libwebsocketsSrcFiles, local_include_dirs: libwebsocketsIncludePath, export_include_dirs: ["include"], static_libs: [ "libssl", "libcap", ], c_std: "gnu17", host_supported: true, product_variables: { debuggable: { cflags: [ "-UNDEBUG", ], }, }, target: { darwin: { enabled: false, }, android: { shared_libs: [ "libcrypto", ], cflags: [ "-Wno-unused-parameter", "-Wno-missing-field-initializers", ], }, host: { static_libs: [ "libcrypto", ], cflags: [ "-UNDEBUG", "-Wall", "-Wsign-compare", "-Wstrict-aliasing", "-Wuninitialized", "-Werror", "-fvisibility=hidden", "-Wundef", "-Wtype-limits", "-Wignored-qualifiers", "-Wno-deprecated-declarations", "-pthread", "-Wno-unused-command-line-argument", "-Wno-unused-parameter", "-Wno-implicit-function-declaration", ], }, }, }