CMakeLists.txt 807 B

1234567891011121314151617181920212223242526
  1. cmake_minimum_required(VERSION 3.16)
  2. include($ENV{IDF_PATH}/tools/cmake/project.cmake)
  3. set(COMPONENTS main)
  4. # Freertos is included via common components, however, currently only the mock component is compatible with linux
  5. # target.
  6. list(APPEND EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/mocks/freertos/")
  7. project(host_test_spiffs)
  8. # Custom procedure to build/clean image.bin
  9. add_custom_target(image.bin)
  10. # Expand image.bin to the same size as "spiffs" partition in partition_table.csv - 2*1024*1024 = 2097152 = 2M
  11. add_custom_command(
  12. TARGET image.bin
  13. POST_BUILD
  14. COMMAND python ../../spiffsgen.py 2097152 ../../spiffs ${build_dir}/image.bin
  15. )
  16. set_property(
  17. DIRECTORY
  18. APPEND PROPERTY ADDITIONAL_CLEAN_FILES "${build_dir}/image.bin")
  19. add_dependencies(host_test_spiffs.elf image.bin)