CMakeLists.txt 1.0 KB

123456789101112131415161718192021222324252627
  1. idf_build_get_property(target IDF_TARGET)
  2. set(original_srcs "spiffs/src/spiffs_cache.c"
  3. "spiffs/src/spiffs_check.c"
  4. "spiffs/src/spiffs_gc.c"
  5. "spiffs/src/spiffs_hydrogen.c"
  6. "spiffs/src/spiffs_nucleus.c")
  7. list(APPEND srcs "spiffs_api.c" ${original_srcs})
  8. if(NOT ${target} STREQUAL "linux")
  9. list(APPEND pr bootloader_support esptool_py vfs)
  10. list(APPEND srcs "esp_spiffs.c")
  11. endif()
  12. idf_component_register(SRCS ${srcs}
  13. INCLUDE_DIRS "include"
  14. PRIV_INCLUDE_DIRS "." "spiffs/src"
  15. REQUIRES esp_partition
  16. PRIV_REQUIRES ${pr} spi_flash)
  17. if(CMAKE_C_COMPILER_ID MATCHES "GNU")
  18. set_source_files_properties(spiffs/src/spiffs_nucleus.c PROPERTIES COMPILE_FLAGS -Wno-stringop-truncation)
  19. endif()
  20. # Upstream SPIFFS code uses format specifiers in debug logging macros inconsistently
  21. set_source_files_properties(${original_srcs} PROPERTIES COMPILE_FLAGS -Wno-format)