esp-idf/components/esp_netif/CMakeLists.txt
David Cermak 5e19b9c951 esp-netif: Make dependency on esp-eth optional
* esp-netif to optionally depend on esp-eth (only for l2tap config)
* esp_eth.h now includes the original ethernet header and the
ethernet-netif glue layer
* Updated examples and test to explicitely use esp-eth dependency if
needed
2022-06-09 07:55:40 +00:00

49 lines
1.0 KiB
CMake

idf_build_get_property(target IDF_TARGET)
if(${target} STREQUAL "linux")
# Header only library for linux
idf_component_register(INCLUDE_DIRS include)
return()
endif()
set(srcs
"esp_netif_handlers.c"
"esp_netif_objects.c"
"esp_netif_defaults.c"
"lwip/esp_netif_lwip.c"
"lwip/esp_netif_lwip_defaults.c"
"lwip/esp_netif_sta_list.c")
set(include_dirs "include")
set(priv_include_dirs "lwip" "private_include")
if(CONFIG_LWIP_SLIP_SUPPORT)
list(APPEND srcs
"lwip/esp_netif_lwip_slip.c")
endif()
if(CONFIG_PPP_SUPPORT)
list(APPEND srcs
"lwip/esp_netif_lwip_ppp.c")
endif()
if(CONFIG_LWIP_NETIF_LOOPBACK)
list(APPEND srcs
"loopback/esp_netif_loopback.c")
endif()
if(CONFIG_ESP_NETIF_L2_TAP)
list(APPEND srcs
"vfs_l2tap/esp_vfs_l2tap.c")
endif()
idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS "${include_dirs}"
PRIV_INCLUDE_DIRS "${priv_include_dirs}"
REQUIRES lwip)
if(CONFIG_ESP_NETIF_L2_TAP)
idf_component_optional_requires(PRIVATE esp_eth)
endif()