CMakeLists.txt 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. idf_build_get_property(target IDF_TARGET)
  2. if(${target} STREQUAL "linux")
  3. return() # This component is not supported by the POSIX/Linux simulator
  4. endif()
  5. set(srcs "src/core_dump_common.c"
  6. "src/core_dump_checksum.c"
  7. "src/core_dump_flash.c"
  8. "src/core_dump_uart.c"
  9. "src/core_dump_elf.c"
  10. "src/core_dump_binary.c")
  11. set(includes "include")
  12. set(priv_includes "include_core_dump")
  13. idf_build_get_property(target IDF_TARGET)
  14. if(CONFIG_IDF_TARGET_ARCH_XTENSA)
  15. list(APPEND srcs "src/port/xtensa/core_dump_port.c")
  16. list(APPEND includes "include/port/xtensa")
  17. list(APPEND priv_includes "include_core_dump/port/xtensa")
  18. elseif(CONFIG_IDF_TARGET_ARCH_RISCV)
  19. list(APPEND srcs "src/port/riscv/core_dump_port.c")
  20. list(APPEND includes "include/port/riscv")
  21. list(APPEND priv_includes "include_core_dump/port/riscv")
  22. endif()
  23. idf_component_register(SRCS ${srcs}
  24. INCLUDE_DIRS ${includes}
  25. PRIV_INCLUDE_DIRS ${priv_includes}
  26. LDFRAGMENTS linker.lf
  27. PRIV_REQUIRES esp_partition spi_flash bootloader_support mbedtls esp_rom soc esp_system
  28. esp_driver_gpio
  29. # [refactor-todo] esp_flash_internal.h -> spi_common_internal.h requires cleanup
  30. driver
  31. )
  32. if(CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF)
  33. target_link_libraries(${COMPONENT_LIB} PRIVATE idf::esp_app_format)
  34. endif()