diff --git a/components/mdns/CMakeLists.txt b/components/mdns/CMakeLists.txt index 405e9f7855..5823849b05 100644 --- a/components/mdns/CMakeLists.txt +++ b/components/mdns/CMakeLists.txt @@ -34,7 +34,9 @@ if(${target} STREQUAL "linux") target_link_libraries(${COMPONENT_LIB} PRIVATE "-lbsd") endif() - if(CONFIG_ETH_ENABLED) idf_component_optional_requires(PRIVATE esp_eth) endif() + +idf_component_get_property(MDNS_VERSION ${COMPONENT_NAME} COMPONENT_VERSION) +target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DESP_MDNS_VERSION_NUMBER=\"${MDNS_VERSION}\"") diff --git a/components/mdns/examples/query_advertise/main/mdns_example_main.c b/components/mdns/examples/query_advertise/main/mdns_example_main.c index a6aaea2d4c..2373e7ecba 100644 --- a/components/mdns/examples/query_advertise/main/mdns_example_main.c +++ b/components/mdns/examples/query_advertise/main/mdns_example_main.c @@ -314,6 +314,8 @@ void app_main(void) ESP_ERROR_CHECK(esp_netif_init()); ESP_ERROR_CHECK(esp_event_loop_create_default()); + ESP_LOGI(TAG, "mDNS Ver: %s", ESP_MDNS_VERSION_NUMBER); + initialise_mdns(); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.