esp-idf/examples/protocols/sockets/tcp_client/main/CMakeLists.txt
Harshit Malpani 0798691bf0
fix: Fix protocols example to build without setting target
Protocol examples used to raise an error if the target was not set
and `idf.py build` command was used. This commit fix this error
and when IDF_TARGET is not set, ESP32 is selected as default target
2023-09-20 17:50:16 +05:30

16 lines
460 B
CMake

idf_build_get_property(target IDF_TARGET)
if(${target} STREQUAL "linux")
set(requires esp_event esp_stubs protocol_examples_common nvs_flash)
endif()
if("${CONFIG_EXAMPLE_IPV4}" STREQUAL y)
set(tcp_client_ip tcp_client_v4.c)
else()
set(tcp_client_ip tcp_client_v6.c)
endif()
idf_component_register(SRCS "tcp_client_main.c" "${tcp_client_ip}"
INCLUDE_DIRS "."
REQUIRES ${requires})