CMakeLists.txt 1.4 KB

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