-
-
Notifications
You must be signed in to change notification settings - Fork 97
/
CMakeLists.txt
44 lines (35 loc) · 1.19 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.10)
file(GLOB SOURCES src/littlefs/*.c)
list(APPEND SOURCES src/esp_littlefs.c src/littlefs_esp_part.c src/lfs_config.c)
if(CONFIG_LITTLEFS_SDMMC_SUPPORT)
list(APPEND SOURCES src/littlefs_sdmmc.c)
endif()
if(IDF_VERSION_MAJOR GREATER_EQUAL 5)
list(APPEND pub_requires esp_partition)
else()
list(APPEND pub_requires spi_flash)
endif()
list(APPEND priv_requires esptool_py spi_flash vfs sdmmc)
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()