feat(lws): add Kconfig toggles + bump submodule

Add three Kconfig options so consumers can tune libwebsockets without
forking this component:

  CONFIG_LWS_WITH_EXTENSIONS  (default n) — permessage-deflate / mux
  CONFIG_LWS_WITH_FILE_OPS    (default y) — server-side VFS layer
  CONFIG_LWS_WITH_THREADPOOL  (default n) — managed worker thread pool

Defaults preserve the previously-baked behaviour, so existing consumers
see zero change. AWS KVS WebRTC signaling — the immediate driver — flips
EXTENSIONS=y / FILE_OPS=n / THREADPOOL=y; with this PR those workloads
can consume espressif/libwebsockets from the registry instead of
carrying a local fork that twiddles the same knobs.

Also bumps the bundled libwebsockets submodule from a74362ff -> d659d4f2
(93 commits forward on the warmcat 4.3.x mainline). Picks up upstream
fixes (incl. the Linux-host build path landed via earlier espressif
contribution). No source-level patches on top — just the submodule pin.

Verified locally on esp32s3 with both default and KVS-flavour Kconfig:
configure clean; LWS_* CMake variables resolve correctly from Kconfig
(LWS_WITHOUT_EXTENSIONS / LWS_WITH_FILE_OPS / LWS_WITH_THREADPOOL all
follow the booleans).
This commit is contained in:
Vikram Dattu
2026-05-25 15:45:58 +05:30
parent 1c26376cd9
commit 23448d547f
3 changed files with 60 additions and 1 deletions
+24
View File
@@ -4,6 +4,27 @@ set(LWS_WITH_EXPORT_LWSTARGETS OFF CACHE BOOL "Export libwebsockets CMake target
set(LWS_WITH_MBEDTLS ON CACHE BOOL "Use mbedTLS (>=2.0) replacement for OpenSSL.")
set(LWS_WITH_JPEG OFF CACHE BOOL "Enable stateful JPEG stream decoder")
# Kconfig-driven libwebsockets options. Defaults preserve the previous
# behaviour (extensions off, file_ops on, threadpool off) so existing
# consumers see no change. See Kconfig for help text and per-knob rationale.
if(CONFIG_LWS_WITH_EXTENSIONS)
set(LWS_WITHOUT_EXTENSIONS OFF CACHE INTERNAL "Compile with extensions")
else()
set(LWS_WITHOUT_EXTENSIONS ON CACHE INTERNAL "Don't compile with extensions")
endif()
if(CONFIG_LWS_WITH_FILE_OPS)
set(LWS_WITH_FILE_OPS ON CACHE INTERNAL "Support file operations vfs")
else()
set(LWS_WITH_FILE_OPS OFF CACHE INTERNAL "Drop file operations vfs")
endif()
if(CONFIG_LWS_WITH_THREADPOOL)
set(LWS_WITH_THREADPOOL ON CACHE INTERNAL "Managed worker thread pool support")
else()
set(LWS_WITH_THREADPOOL OFF CACHE INTERNAL "No worker thread pool")
endif()
set(WRAP_FUNCTIONS mbedtls_ssl_handshake_step
lws_adopt_descriptor_vhost)
@@ -18,3 +39,6 @@ target_sources(${COMPONENT_LIB} INTERFACE "port/lws_port.c")
add_subdirectory(libwebsockets)
# pollfd.c at this lws pin has an unused 'vpt' on FreeRTOS; drop after the next bump.
target_compile_options(websockets PRIVATE -Wno-unused-variable)
+35
View File
@@ -0,0 +1,35 @@
menu "libwebsockets"
# All defaults below preserve the previously-baked behaviour
# (extensions off, file_ops on, threadpool off). Flip them to suit
# the workload — e.g. WebRTC signaling consumers enable extensions
# for permessage-deflate and threadpool for parallel TLS work.
config LWS_WITH_EXTENSIONS
bool "Build libwebsockets with extensions (permessage-deflate, mux)"
default n
help
Enables LWS extensions support. Required for clients/servers
that negotiate permessage-deflate or other RFC 7692 extensions
over the WebSocket handshake. Requires LWS_WITH_ZLIB at link
time, which the ESP-IDF mbedTLS build does not pull in by
default — you'll need to add zlib as a dependency.
config LWS_WITH_FILE_OPS
bool "Build libwebsockets with the file-operations VFS"
default y
help
Compiles the libwebsockets virtual filesystem layer used by
server-side static file serving. Disable on embedded targets
that don't expose a real filesystem to lws to save flash.
config LWS_WITH_THREADPOOL
bool "Build libwebsockets with the worker threadpool API"
default n
help
Enables lws's managed worker thread pool (pthread-backed).
Used by clients that want to off-load parallel TLS handshake
or other work from the lws service thread (e.g. AWS KVS
WebRTC signaling). Costs a few hundred bytes of static data.
endmenu