esp-idf/components/esp_eth/CMakeLists.txt

52 wiersze
1.7 KiB
CMake
Czysty Zwykły widok Historia

idf_build_get_property(components_to_build BUILD_COMPONENTS)
set(srcs)
set(include)
set(priv_requires)
2019-04-10 08:24:50 +00:00
# If Ethernet disabled in Kconfig, this is a config-only component
if(CONFIG_ETH_ENABLED)
2019-12-23 09:06:02 +00:00
set(srcs "src/esp_eth.c" "src/esp_eth_phy.c")
set(include "include")
set(priv_requires "driver" "log") # require "driver" for using some GPIO APIs
2020-01-09 11:32:51 +00:00
if(NOT CMAKE_BUILD_EARLY_EXPANSION)
# esp_netif related
if(esp_netif IN_LIST components_to_build)
list(APPEND srcs "src/esp_eth_netif_glue.c")
list(APPEND priv_requires esp_netif esp_pm)
2020-01-09 11:32:51 +00:00
endif()
endif()
if(CONFIG_ETH_USE_ESP32_EMAC)
list(APPEND srcs "src/esp_eth_mac_esp32.c"
"src/esp_eth_phy_dp83848.c"
"src/esp_eth_phy_ip101.c"
"src/esp_eth_phy_ksz8041.c"
"src/esp_eth_phy_lan8720.c"
"src/esp_eth_phy_rtl8201.c")
endif()
2019-04-10 08:24:50 +00:00
if(CONFIG_ETH_SPI_ETHERNET_DM9051)
list(APPEND srcs "src/esp_eth_mac_dm9051.c"
"src/esp_eth_phy_dm9051.c")
endif()
if(CONFIG_ETH_SPI_ETHERNET_W5500)
list(APPEND srcs "src/esp_eth_mac_w5500.c"
"src/esp_eth_phy_w5500.c")
endif()
if(CONFIG_ETH_USE_OPENETH)
list(APPEND srcs "src/esp_eth_mac_openeth.c")
endif()
endif()
idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS ${include}
REQUIRES "esp_event" # For using "ESP_EVENT_DECLARE_BASE" in header file
PRIV_REQUIRES ${priv_requires})
# uses C11 atomic feature
set_source_files_properties(src/esp_eth.c PROPERTIES COMPILE_FLAGS -std=gnu11)