CMakeLists.txt 954 B

12345678910111213141516171819202122232425
  1. idf_build_get_property(target IDF_TARGET)
  2. set(srcs "log.c")
  3. set(priv_requires "")
  4. if(${target} STREQUAL "linux")
  5. # We leave log buffers out for now on Linux since it's rarely used. Explicitely add esp_rom to Linux target
  6. # since we don't have the common components there yet.
  7. list(APPEND srcs "log_linux.c")
  8. else()
  9. list(APPEND srcs "log_buffers.c")
  10. list(APPEND priv_requires soc)
  11. endif()
  12. idf_component_register(SRCS ${srcs}
  13. INCLUDE_DIRS "include"
  14. LDFRAGMENTS linker.lf
  15. PRIV_REQUIRES ${priv_requires})
  16. if(NOT ${target} STREQUAL "linux")
  17. # Ideally, FreeRTOS shouldn't be included into bootloader build, so the 2nd check should be unnecessary
  18. if(freertos IN_LIST BUILD_COMPONENTS AND NOT BOOTLOADER_BUILD)
  19. target_sources(${COMPONENT_TARGET} PRIVATE log_freertos.c)
  20. else()
  21. target_sources(${COMPONENT_TARGET} PRIVATE log_noos.c)
  22. endif()
  23. endif()