diff --git a/CMakeLists.txt b/CMakeLists.txt index ca02f3f..37f94db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,14 +1,16 @@ +idf_build_get_property(idf_target IDF_TARGET) + set(priv_requires esp_netif esp_wifi nvs_flash) set(requires "") -if(CONFIG_SOC_EMAC_SUPPORTED) +if(idf_target STREQUAL "esp32" OR idf_target STREQUAL "esp32p4") list(APPEND priv_requires esp_eth esp_driver_gpio ethernet_init) list(APPEND requires lan87xx) endif() idf_component_register( - SRC_DIRS "." - PRIV_REQUIRES ${priv_requires} - REQUIRES ${requires} - INCLUDE_DIRS "." + SRC_DIRS "." + PRIV_REQUIRES ${priv_requires} + REQUIRES ${requires} + INCLUDE_DIRS "." ) \ No newline at end of file