fix(dns_over_https): declare main and protocol_examples_common deps

dns_over_https/main includes time_sync.h, nvs_flash.h, esp_event.h,
esp_timer.h, and mbedtls headers. Declare nvs_flash, esp_event,
esp_timer, mbedtls and time_sync in PRIV_REQUIRES so the build is
self-describing under any build system.

Also move esp_netif from PRIV_REQUIRES to REQUIRES in
protocol_examples_common, since its public header exposes esp_netif.h.

Also add the PRIVATE keyword to target_link_libraries in the
dns_over_https component — CMake rejects mixed keyword/plain
signatures on the same target.
This commit is contained in:
Sudeep Mohanty
2026-04-22 14:48:35 +02:00
parent 964c438587
commit aee4403d91
3 changed files with 4 additions and 2 deletions

View File

@@ -3,5 +3,5 @@ idf_component_register(SRCS "dns_over_https.c" "dns_utils.c"
PRIV_REQUIRES nvs_flash lwip esp_event esp-tls esp_http_client)
if(CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM)
target_link_libraries(${COMPONENT_LIB} "-u lwip_hook_netconn_external_resolve")
target_link_libraries(${COMPONENT_LIB} PRIVATE "-u lwip_hook_netconn_external_resolve")
endif()

View File

@@ -7,4 +7,5 @@ endif()
idf_component_register(SRCS "example_dns_over_https.c"
INCLUDE_DIRS "."
PRIV_REQUIRES time_sync nvs_flash esp_event esp_timer mbedtls
EMBED_TXTFILES ${cert_file})