Skip to content

Commit

Permalink
feat(mdns): Make including mdns_console KConfigurable
Browse files Browse the repository at this point in the history
The CLI that mdns_console offers is very useful for debugging
and bootstrapping mDNS onto new projects, but some projects
may not want console CLI in place to reduce binary size.

This gives a KConfig option to do so.
  • Loading branch information
rretanubun committed Jan 26, 2024
1 parent 5ba7cfa commit 27adbfe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 7 additions & 1 deletion components/mdns/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@ else()
set(MDNS_NETWORKING "mdns_networking_lwip.c")
endif()

if(CONFIG_MDNS_ENABLE_CONSOLE_CLI)
set(MDNS_CONSOLE "mdns_console.c")
else()
set(MDNS_CONSOLE "")
endif()

idf_build_get_property(target IDF_TARGET)
if(${target} STREQUAL "linux")
set(dependencies esp_netif_linux esp_timer esp_system)
set(srcs "mdns.c" ${MDNS_NETWORKING})
else()
set(dependencies lwip console esp_netif)
set(private_dependencies esp_timer esp_wifi)
set(srcs "mdns.c" ${MDNS_NETWORKING} "mdns_console.c")
set(srcs "mdns.c" ${MDNS_NETWORKING} ${MDNS_CONSOLE})
endif()

idf_component_register(
Expand Down
6 changes: 6 additions & 0 deletions components/mdns/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ menu "mDNS"
help
Enable for the library to log received and sent mDNS packets to stdout.

config MDNS_ENABLE_CONSOLE_CLI
bool "Enable Command Line Interface on device console"
default y
help
Enable for the console cli to be available on the device.

config MDNS_RESPOND_REVERSE_QUERIES
bool "Enable responding to IPv4 reverse queries"
default n
Expand Down

0 comments on commit 27adbfe

Please sign in to comment.