CMakeLists.txt 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. idf_build_get_property(target IDF_TARGET)
  2. if(${target} STREQUAL "linux")
  3. set(ldfragments)
  4. set(srcs "src/esp_err_check_linux.c")
  5. else()
  6. set(ldfragments common.lf soc.lf)
  7. set(srcs)
  8. endif()
  9. list(APPEND srcs "src/esp_err_to_name.c")
  10. # Note: esp_ipc, esp_pm added as a public requirement to keep compatibility as to be located here.
  11. idf_component_register(SRCS "${srcs}"
  12. INCLUDE_DIRS include
  13. LDFRAGMENTS ${ldfragments})
  14. set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY LINK_INTERFACE_MULTIPLICITY 4)
  15. # List of components needed for the error codes list
  16. set(optional_reqs ulp
  17. efuse
  18. esp_http_client
  19. esp_http_server
  20. bootloader_support
  21. nvs_flash
  22. esp_wifi
  23. app_update
  24. lwip
  25. spi_flash
  26. wpa_supplicant
  27. esp_serial_slave_link
  28. esp_netif
  29. soc
  30. esp-tls
  31. esp_https_ota
  32. esp_hw_support)
  33. idf_build_get_property(build_components BUILD_COMPONENTS)
  34. foreach(req ${optional_reqs})
  35. if(req IN_LIST build_components)
  36. idf_component_get_property(req_lib ${req} COMPONENT_LIB)
  37. target_link_libraries(${COMPONENT_LIB} PRIVATE ${req_lib})
  38. endif()
  39. endforeach()