# select features recommended for PC distro packaging
option('LWS_WITH_DISTRO_RECOMMENDED', type: 'boolean', value: false, description: 'Enable features recommended for distro packaging')
option('LWS_FOR_GITOHASHI', type: 'boolean', value: false, description: 'Enable features recommended for use with gitohashi')

# Major individual features
option('LWS_WITH_NETWORK', type: 'boolean', value: true, description: 'Compile with network-related code')
option('LWS_ROLE_H1', type: 'boolean', value: true, description: 'Compile with support for http/1 (needed for ws)')
option('LWS_ROLE_WS', type: 'boolean', value: true, description: 'Compile with support for websockets')
option('LWS_ROLE_MQTT', type: 'boolean', value: false, description: 'Build with support for MQTT client')
option('LWS_ROLE_DBUS', type: 'boolean', value: false, description: 'Compile with support for DBUS')
option('LWS_ROLE_RAW_PROXY', type: 'boolean', value: false, description: 'Raw packet proxy')
option('LWS_ROLE_RAW_FILE', type: 'boolean', value: true, description: 'Compile with support for raw files')
option('LWS_WITH_HTTP2', type: 'boolean', value: true, description: 'Compile with server support for HTTP/2')
option('LWS_WITH_LWSWS', type: 'boolean', value: false, description: 'Libwebsockets Webserver')
option('LWS_WITH_CGI', type: 'boolean', value: false, description: 'Include CGI (spawn process with network-connected stdin/out/err) APIs')
option('LWS_IPV6', type: 'boolean', value: false, description: 'Compile with support for ipv6')
option('LWS_UNIX_SOCK', type: 'boolean', value: false, description: 'Compile with support for UNIX domain socket')
option('LWS_WITH_PLUGINS', type: 'boolean', value: false, description: 'Support plugins for protocols and extensions')
option('LWS_WITH_HTTP_PROXY', type: 'boolean', value: false, description: 'Support for active HTTP proxying')
option('LWS_WITH_ZIP_FOPS', type: 'boolean', value: false, description: 'Support serving pre-zipped files')
option('LWS_WITH_SOCKS5', type: 'boolean', value: false, description: 'Allow use of SOCKS5 proxy on client connections')
option('LWS_WITH_GENERIC_SESSIONS', type: 'boolean', value: false, description: 'With the Generic Sessions plugin')
option('LWS_WITH_PEER_LIMITS', type: 'boolean', value: false, description: 'Track peers and restrict resources a single peer can allocate')
option('LWS_WITH_ACCESS_LOG', type: 'boolean', value: false, description: 'Support generating Apache-compatible access logs')
option('LWS_WITH_RANGES', type: 'boolean', value: false, description: 'Support http ranges (RFC7233)')
option('LWS_WITH_SERVER_STATUS', type: 'boolean', value: false, description: 'Support json + jscript server monitoring')
option('LWS_WITH_THREADPOOL', type: 'boolean', value: false, description: 'Managed worker thread pool support (relies on pthreads)')
option('LWS_WITH_HTTP_STREAM_COMPRESSION', type: 'boolean', value: false, description: 'Support HTTP stream compression')
option('LWS_WITH_HTTP_BROTLI', type: 'boolean', value: false, description: 'Also offer brotli http stream compression (requires LWS_WITH_HTTP_STREAM_COMPRESSION)')
option('LWS_WITH_ACME', type: 'boolean', value: false, description: 'Enable support for ACME automatic cert acquisition + maintenance (letsencrypt etc)')
option('LWS_WITH_HUBBUB', type: 'boolean', value: false, description: 'Enable libhubbub rewriting support')
option('LWS_WITH_ALSA', type: 'boolean', value: false, description: 'Enable alsa audio example')
option('LWS_WITH_GTK', type: 'boolean', value: false, description: 'Enable gtk example')
option('LWS_WITH_FTS', type: 'boolean', value: false, description: 'Full Text Search support')
option('LWS_WITH_SYS_ASYNC_DNS', type: 'boolean', value: false, description: 'Nonblocking internal IPv4 + IPv6 DNS resolver')
option('LWS_WITH_SYS_NTPCLIENT', type: 'boolean', value: false, description: 'Build in tiny ntpclient good for tls date validation and run via lws_system')
option('LWS_WITH_SYS_DHCP_CLIENT', type: 'boolean', value: false, description: 'Build in tiny DHCP client')
option('LWS_WITH_HTTP_BASIC_AUTH', type: 'boolean', value: true, description: 'Support Basic Auth')
option('LWS_WITH_HTTP_UNCOMMON_HEADERS', type: 'boolean', value: true, description: 'Include less common http header support')

# Secure Streams
option('LWS_WITH_SECURE_STREAMS', type: 'boolean', value: false, description: 'Secure Streams protocol-agnostic API')
option('LWS_WITH_SECURE_STREAMS_PROXY_API', type: 'boolean', value: false, description: 'Secure Streams support to work across processes')
option('LWS_WITH_SECURE_STREAMS_SYS_AUTH_API_AMAZON_COM', type: 'boolean', value: false, description: 'Auth support for api.amazon.com')

# TLS library
option('LWS_WITH_SSL', type: 'boolean', value: true, description: 'Include SSL support (defaults to OpenSSL or similar, mbedTLS if LWS_WITH_MBEDTLS is set)')
option('LWS_WITH_MBEDTLS', type: 'boolean', value: false, description: 'Use mbedTLS (>=2.0) replacement for OpenSSL. When setting this, you also may need to specify LWS_MBEDTLS_LIBRARIES and LWS_MBEDTLS_INCLUDE_DIRS')
option('LWS_WITH_BORINGSSL', type: 'boolean', value: false, description: 'Use BoringSSL replacement for OpenSSL')
option('LWS_WITH_CYASSL', type: 'boolean', value: false, description: 'Use CyaSSL replacement for OpenSSL. When setting this, you also need to specify LWS_CYASSL_LIBRARIES and LWS_CYASSL_INCLUDE_DIRS')
option('LWS_WITH_WOLFSSL', type: 'boolean', value: false, description: 'Use wolfSSL replacement for OpenSSL. When setting this, you also need to specify LWS_WOLFSSL_LIBRARIES and LWS_WOLFSSL_INCLUDE_DIRS')
option('LWS_SSL_CLIENT_USE_OS_CA_CERTS', type: 'boolean', value: true, description: 'SSL support should make use of the OS-installed CA root certs')

# Event library options
option('LWS_WITH_LIBEV', type: 'boolean', value: false, description: 'Compile with support for libev')
option('LWS_WITH_LIBUV', type: 'boolean', value: false, description: 'Compile with support for libuv')
option('LWS_WITH_LIBEVENT', type: 'boolean', value: false, description: 'Compile with support for libevent')
option('LWS_WITH_GLIB', type: 'boolean', value: false, description: 'Compile with support for glib event loop')

# Static / Dynamic build options
option('LWS_WITH_STATIC', type: 'boolean', value: true, description: 'Build the static version of the library')
option('LWS_WITH_SHARED', type: 'boolean', value: true, description: 'Build the shared version of the library')
option('LWS_LINK_TESTAPPS_DYNAMIC', type: 'boolean', value: false, description: 'Link the test apps to the shared version of the library. Default is to link statically')
option('LWS_STATIC_PIC', type: 'boolean', value: false, description: 'Build the static version of the library with position-independent code')

# Specific platforms
option('LWS_WITH_ESP32', type: 'boolean', value: false, description: 'Build for ESP32')
option('LWS_WITH_ESP32_HELPER', type: 'boolean', value: false, description: 'Build ESP32 helper')
option('LWS_PLAT_OPTEE', type: 'boolean', value: false, description: 'Build for OPTEE')
option('LWS_PLAT_FREERTOS', type: 'boolean', value: false, description: 'Build for FreeRTOS')
option('LWS_PLAT_ANDROID', type: 'boolean', value: false, description: 'Android flavour of unix platform')

# Client / Server / Test Apps build control
option('LWS_WITHOUT_CLIENT', type: 'boolean', value: false, description: 'Don\'t build the client part of the library')
option('LWS_WITHOUT_SERVER', type: 'boolean', value: false, description: 'Don\'t build the server part of the library')
option('LWS_WITHOUT_TESTAPPS', type: 'boolean', value: false, description: 'Don\'t build the libwebsocket-test-apps')
option('LWS_WITHOUT_TEST_SERVER', type: 'boolean', value: false, description: 'Don\'t build the test server')
option('LWS_WITHOUT_TEST_SERVER_EXTPOLL', type: 'boolean', value: false, description: 'Don\'t build the test server version that uses external poll')
option('LWS_WITHOUT_TEST_PING', type: 'boolean', value: false, description: 'Don\'t build the ping test application')
option('LWS_WITHOUT_TEST_CLIENT', type: 'boolean', value: false, description: 'Don\'t build the client test application')

# Extensions
option('LWS_WITHOUT_EXTENSIONS', type: 'boolean', value: true, description: 'Don\'t compile with extensions')

# Helpers + misc
option('LWS_WITHOUT_BUILTIN_GETIFADDRS', type: 'boolean', value: false, description: 'Don\'t use the BSD getifaddrs implementation from libwebsockets if it is missing (this will result in a compilation error) ... The default is to assume that your libc provides it. On some systems such as uclibc it doesn\'t exist.')
option('LWS_FALLBACK_GETHOSTBYNAME', type: 'boolean', value: false, description: 'Also try to do dns resolution using gethostbyname if getaddrinfo fails')
option('LWS_WITHOUT_BUILTIN_SHA1', type: 'boolean', value: false, description: 'Don\'t build the lws sha-1 (eg, because openssl will provide it')
option('LWS_WITHOUT_DAEMONIZE', type: 'boolean', value: true, description: 'Don\'t build the daemonization api')
option('LWS_SSL_SERVER_WITH_ECDH_CERT', type: 'boolean', value: false, description: 'Include SSL server use ECDH certificate')
option('LWS_WITH_LEJP', type: 'boolean', value: true, description: 'With the Lightweight JSON Parser')
option('LWS_WITH_SQLITE3', type: 'boolean', value: false, description: 'Require SQLITE3 support')
option('LWS_WITH_STRUCT_JSON', type: 'boolean', value: false, description: 'Generic struct serialization to and from JSON')
option('LWS_WITH_STRUCT_SQLITE3', type: 'boolean', value: false, description: 'Generic struct serialization to and from SQLITE3')
option('LWS_WITH_DIR', type: 'boolean', value: true, description: 'Directory scanning api support')
option('LWS_WITH_LEJP_CONF', type: 'boolean', value: true, description: 'With LEJP configuration parser as used by lwsws')
option('LWS_WITH_NO_LOGS', type: 'boolean', value: false, description: 'Disable all logging other than _err and _user from being compiled in')
option('LWS_LOGGING_BITFIELD_SET', type: 'string', value: '0', description: 'Bitfield describing which log levels to force included into the build')
option('LWS_LOGGING_BITFIELD_CLEAR', type: 'string', value: '0', description: 'Bitfield describing which log levels to force removed from the build')
option('LWS_LOGS_TIMESTAMP', type: 'boolean', value: true, description: 'Timestamp at start of logs')
option('LWS_AVOID_SIGPIPE_IGN', type: 'boolean', value: false, description: 'Android 7+ reportedly needs this')
option('LWS_WITH_STATS', type: 'boolean', value: false, description: 'Keep statistics of lws internal operations')
option('LWS_WITH_JOSE', type: 'boolean', value: false, description: 'JSON Web Signature / Encryption / Keys (RFC7515/6/) API')
option('LWS_WITH_GENCRYPTO', type: 'boolean', value: false, description: 'Enable support for Generic Crypto apis independent of TLS backend')
option('LWS_WITH_SELFTESTS', type: 'boolean', value: false, description: 'Selftests run at context creation')
option('LWS_WITH_GCOV', type: 'boolean', value: false, description: 'Build with gcc gcov coverage instrumentation')
option('LWS_WITH_EXPORT_LWSTARGETS', type: 'boolean', value: true, description: 'Export libwebsockets CMake targets.  Disable if they conflict with an outer cmake project.')
option('LWS_REPRODUCIBLE', type: 'boolean', value: true, description: 'Build libwebsockets reproducible. It removes the build user and hostname from the build')
option('LWS_WITH_MINIMAL_EXAMPLES', type: 'boolean', value: false, description: 'Also build the normally standalone minimal examples, for QA')
option('LWS_WITH_LWSAC', type: 'boolean', value: true, description: 'lwsac Chunk Allocation api')
option('LWS_WITH_CUSTOM_HEADERS', type: 'boolean', value: true, description: 'Store and allow querying custom HTTP headers (H1 only)')
option('LWS_WITH_DISKCACHE', type: 'boolean', value: false, description: 'Hashed cache directory with lazy LRU deletion to size limit')
option('LWS_WITH_ASAN', type: 'boolean', value: false, description: 'Build with gcc runtime sanitizer options enabled (needs libasan)')
option('LWS_WITH_ZLIB', type: 'boolean', value: false, description: 'Include zlib support (required for extensions)')
option('LWS_WITH_BUNDLED_ZLIB', type: 'boolean', value: false, description: 'Use bundled zlib version (Windows only)')
option('LWS_WITH_MINIZ', type: 'boolean', value: false, description: 'Use miniz instead of zlib')
option('LWS_WITH_DEPRECATED_LWS_DLL', type: 'boolean', value: false, description: 'Migrate to lws_dll2 instead ASAP')
option('LWS_WITH_SEQUENCER', type: 'boolean', value: true, description: 'lws_seq_t support')
option('LWS_WITH_EXTERNAL_POLL', type: 'boolean', value: false, description: 'Support external POLL integration using callback messages (not recommended)')
option('LWS_WITH_LWS_DSH', type: 'boolean', value: false, description: 'Support lws_dsh_t Disordered Shared Heap')
option('LWS_CLIENT_HTTP_PROXYING', type: 'boolean', value: true, description: 'Support external http proxies for client connections')
option('LWS_WITH_FILE_OPS', type: 'boolean', value: true, description: 'Support file operations vfs')
option('LWS_WITH_DETAILED_LATENCY', type: 'boolean', value: false, description: 'Record detailed latency stats for each read and write')
option('LWS_WITH_UDP', type: 'boolean', value: true, description: 'Platform supports UDP')
option('LWS_WITH_SPAWN', type: 'boolean', value: false, description: 'Spawn subprocesses with piped stdin/out/stderr')
option('LWS_WITH_FSMOUNT', type: 'boolean', value: false, description: 'Overlayfs and fallback mounting apis')
