-
-
Notifications
You must be signed in to change notification settings - Fork 125
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
54 lines (43 loc) · 1.52 KB
/
Copy pathCMakeLists.txt
File metadata and controls
54 lines (43 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
cmake_minimum_required(VERSION 3.16)
file(GLOB SOURCES src/littlefs/*.c)
list(APPEND SOURCES src/esp_littlefs.c src/littlefs_esp_part.c src/lfs_config.c)
if(NOT IDF_TARGET STREQUAL "esp8266" AND "${IDF_VERSION_MAJOR}" VERSION_GREATER_EQUAL "6")
list(APPEND SOURCES src/littlefs_bdl.c)
endif()
if(IDF_TARGET STREQUAL "esp8266")
# ESP8266 configuration here
else()
# non-ESP8266 configuration
list(APPEND pub_requires sdmmc)
if(CONFIG_LITTLEFS_SDMMC_SUPPORT)
list(APPEND SOURCES src/littlefs_sdmmc.c)
endif()
endif()
list(APPEND pub_requires esp_partition)
if(NOT IDF_TARGET STREQUAL "esp8266" AND "${IDF_VERSION_MAJOR}" VERSION_GREATER_EQUAL "6")
list(APPEND pub_requires esp_blockdev)
endif()
list(APPEND priv_requires esptool_py spi_flash vfs)
idf_component_register(
SRCS ${SOURCES}
INCLUDE_DIRS include
PRIV_INCLUDE_DIRS src
REQUIRES ${pub_requires}
PRIV_REQUIRES ${priv_requires}
)
set_source_files_properties(
${SOURCES}
PROPERTIES COMPILE_FLAGS "-DLFS_CONFIG=lfs_config.h"
)
if(CONFIG_LITTLEFS_FCNTL_GET_PATH)
target_compile_definitions(${COMPONENT_LIB} PUBLIC -DF_GETPATH=${CONFIG_LITTLEFS_FCNTL_F_GETPATH_VALUE})
endif()
if(CONFIG_LITTLEFS_MULTIVERSION)
target_compile_definitions(${COMPONENT_LIB} PUBLIC -DLFS_MULTIVERSION)
endif()
if(CONFIG_LITTLEFS_MALLOC_STRATEGY_DISABLE)
target_compile_definitions(${COMPONENT_LIB} PUBLIC -DLFS_NO_MALLOC)
endif()
if(NOT CONFIG_LITTLEFS_ASSERTS)
target_compile_definitions(${COMPONENT_LIB} PUBLIC -DLFS_NO_ASSERT)
endif()