1# SPDX-License-Identifier: Apache-2.0
2
3# check for RF libraries in case ESP32 family is used and BT or WIFI are enabled
4if(CONFIG_BT_ESP32 OR CONFIG_WIFI_ESP32)
5  list(APPEND LIBRARIES "coexist" "core" "net80211" "phy" "pp")
6
7  if(CONFIG_SOC_SERIES_ESP32)
8    list(APPEND LIBRARIES "btdm_app" "rtc")
9  endif()
10
11  if(CONFIG_SOC_SERIES_ESP32C3 OR CONFIG_SOC_SERIES_ESP32S3)
12    list(APPEND LIBRARIES "btbb" "btdm_app")
13  endif()
14
15  foreach(lib ${LIBRARIES})
16    find_library(${lib}_FOUND ${lib} HINTS
17      "${ZEPHYR_HAL_ESPRESSIF_MODULE_DIR}/zephyr/blobs/lib/${CONFIG_SOC_SERIES}")
18
19    if(NOT ${lib}_FOUND)
20      message(FATAL_ERROR
21        "ESP32 RF libraries not found.\n"
22        "Run the command below to download the necessary files:\n"
23        "> west blobs fetch hal_espressif")
24      break()
25    endif()
26  endforeach()
27endif()
28
29add_subdirectory_ifdef(CONFIG_SOC_SERIES_ESP32 esp32)
30add_subdirectory_ifdef(CONFIG_SOC_SERIES_ESP32C3 esp32c3)
31add_subdirectory_ifdef(CONFIG_SOC_SERIES_ESP32S2 esp32s2)
32add_subdirectory_ifdef(CONFIG_SOC_SERIES_ESP32S3 esp32s3)
33