CMakeLists.txt 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. set(priv_requires bootloader_support soc)
  2. if(BOOTLOADER_BUILD)
  3. if (CONFIG_IDF_TARGET_ESP32)
  4. # ESP32 Bootloader needs SPIUnlock from this file, but doesn't
  5. # need other parts of this component
  6. set(srcs "esp32/spi_flash_rom_patch.c")
  7. else()
  8. # but on other platforms no source files are needed for bootloader
  9. set(srcs)
  10. endif()
  11. set(cache_srcs "")
  12. else()
  13. set(cache_srcs
  14. "cache_utils.c"
  15. "flash_mmap.c"
  16. "flash_ops.c"
  17. "${IDF_TARGET}/flash_ops_${IDF_TARGET}.c"
  18. )
  19. set(srcs
  20. "partition.c")
  21. if (CONFIG_IDF_TARGET_ESP32)
  22. list(APPEND srcs
  23. "esp32/spi_flash_rom_patch.c")
  24. endif()
  25. # New implementation after IDF v4.0
  26. list(APPEND srcs
  27. "spi_flash_chip_drivers.c"
  28. "spi_flash_chip_generic.c"
  29. "spi_flash_chip_issi.c"
  30. "spi_flash_chip_mxic.c"
  31. "spi_flash_chip_gd.c"
  32. "memspi_host_driver.c")
  33. list(APPEND cache_srcs
  34. "esp_flash_api.c"
  35. "esp_flash_spi_init.c"
  36. "spi_flash_os_func_app.c"
  37. "spi_flash_os_func_noos.c")
  38. list(APPEND srcs ${cache_srcs})
  39. set(priv_requires bootloader_support app_update soc esp_ipc)
  40. endif()
  41. idf_component_register(SRCS "${srcs}"
  42. PRIV_REQUIRES "${priv_requires}"
  43. INCLUDE_DIRS include
  44. PRIV_INCLUDE_DIRS private_include
  45. LDFRAGMENTS linker.lf)
  46. # Avoid cache miss by unexpected inlineing when built by -Os
  47. set_source_files_properties(${cache_srcs} PROPERTIES COMPILE_FLAGS
  48. "-fno-inline-functions -fno-inline-small-functions -fno-inline-functions-called-once")