Skip to content

Commit 9f18c44

Browse files
authored
Merge pull request #13908 from LDong-Arm/kvstore_libraries
Restructure KVStore to one library per store type
2 parents 86ee300 + 479b704 commit 9f18c44

File tree

39 files changed

+165
-64
lines changed

39 files changed

+165
-64
lines changed

TESTS/configs/baremetal.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
"system-storage",
2626
"SecureStore",
2727
"storage",
28+
"kvstore",
29+
"tdbstore",
30+
"filesystemstore",
2831
"kv-global-api",
2932
"direct-access-devicekey",
3033
"kv-config",

UNITTESTS/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ set(unittest-includes-base
122122
"${PROJECT_SOURCE_DIR}/../storage/kvstore/include"
123123
"${PROJECT_SOURCE_DIR}/../storage/kvstore/kv_config"
124124
"${PROJECT_SOURCE_DIR}/../storage/kvstore/kv_config/include"
125+
"${PROJECT_SOURCE_DIR}/../storage/kvstore/tdbstore/include"
126+
"${PROJECT_SOURCE_DIR}/../storage/kvstore/filesystemstore/include"
127+
"${PROJECT_SOURCE_DIR}/../storage/kvstore/kvstore_global_api/include"
125128
"${PROJECT_SOURCE_DIR}/../drivers"
126129
"${PROJECT_SOURCE_DIR}/../drivers/include"
127130
"${PROJECT_SOURCE_DIR}/../drivers/include/drivers"

drivers/device_key/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ target_sources(mbed-device_key
1717
target_link_libraries(mbed-device_key
1818
INTERFACE
1919
mbed-storage-kvstore
20+
mbed-storage-tdbstore
21+
mbed-storage-kv-global-api
2022
)

drivers/device_key/source/DeviceKey.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
#include "mbedtls/cmac.h"
2222
#include "mbedtls/platform.h"
2323
#include "kvstore/KVStore.h"
24-
#include "kvstore/TDBStore.h"
25-
#include "kvstore/KVMap.h"
24+
#include "tdbstore/TDBStore.h"
25+
#include "kvstore_global_api/KVMap.h"
2626
#include "kv_config/kv_config.h"
2727
#include "mbed_wait_api.h"
2828
#include <stdlib.h>

platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@ target_link_libraries(mbed-psa
2424
INTERFACE
2525
mbed-mbedtls
2626
mbed-storage-kvstore
27+
mbed-storage-tdbstore
28+
mbed-storage-kv-global-api
29+
mbed-device_key
2730
)

storage/CMakeLists.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ add_library(mbed-storage-littlefs INTERFACE)
1818
add_library(mbed-storage-fat INTERFACE)
1919

2020
add_library(mbed-storage-kvstore INTERFACE)
21+
add_library(mbed-storage-tdbstore INTERFACE)
22+
add_library(mbed-storage-filesystemstore INTERFACE)
23+
add_library(mbed-storage-securestore INTERFACE)
24+
add_library(mbed-storage-kv-config INTERFACE)
25+
add_library(mbed-storage-direct-access-devicekey INTERFACE)
26+
add_library(mbed-storage-kv-global-api INTERFACE)
2127

2228

2329
add_subdirectory(blockdevice)
@@ -29,8 +35,3 @@ target_include_directories(mbed-storage
2935
INTERFACE
3036
.
3137
)
32-
33-
target_compile_definitions(mbed-storage
34-
INTERFACE
35-
MBED_CONF_FILESYSTEM_PRESENT=1
36-
)

storage/filesystem/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,8 @@ target_sources(mbed-storage-filesystem
1818
source/File.cpp
1919
source/FileSystem.cpp
2020
)
21+
22+
target_compile_definitions(mbed-storage
23+
INTERFACE
24+
MBED_CONF_FILESYSTEM_PRESENT=1
25+
)

storage/kvstore/CMakeLists.txt

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,16 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
add_subdirectory(direct_access_devicekey)
5-
add_subdirectory(kv_config)
4+
add_subdirectory(tdbstore)
5+
add_subdirectory(filesystemstore)
66
add_subdirectory(securestore)
7+
add_subdirectory(kv_config)
8+
add_subdirectory(direct_access_devicekey)
9+
add_subdirectory(kvstore_global_api)
710

811
target_include_directories(mbed-storage-kvstore
912
INTERFACE
1013
.
11-
./include
12-
./include/kvstore
13-
)
14-
15-
target_sources(mbed-storage-kvstore
16-
INTERFACE
17-
source/FileSystemStore.cpp
18-
source/KVMap.cpp
19-
source/TDBStore.cpp
20-
source/kvstore_global_api.cpp
21-
)
22-
23-
target_link_libraries(mbed-storage-kvstore
24-
INTERFACE
25-
mbed-device_key
26-
mbed-storage-blockdevice
27-
mbed-storage-filesystem
28-
mbed-storage-fat
29-
mbed-storage-littlefs
30-
mbed-storage-flashiap
31-
mbed-storage-sd
14+
include
15+
include/kvstore
3216
)
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
target_include_directories(mbed-storage-kvstore
4+
target_include_directories(mbed-storage-direct-access-devicekey
55
INTERFACE
66
.
7-
./include
8-
./include/direct_access_devicekey
7+
include
8+
include/direct_access_devicekey
99
)
1010

11-
target_sources(mbed-storage-kvstore
11+
target_sources(mbed-storage-direct-access-devicekey
1212
INTERFACE
1313
source/DirectAccessDevicekey.cpp
1414
)
15+
16+
target_link_libraries(mbed-storage-direct-access-devicekey
17+
INTERFACE
18+
mbed-storage-kvstore
19+
mbed-storage-kv-config
20+
)

storage/kvstore/tests/TESTS/direct_access_devicekey/tdb/main.cpp renamed to storage/kvstore/direct_access_devicekey/tests/TESTS/direct_access_devicekey/tdb/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
#include <string.h>
2525
#include "DeviceKey.h"
2626
#include "kvstore/KVStore.h"
27-
#include "kvstore/KVMap.h"
27+
#include "kvstore_global_api/KVMap.h"
2828
#include "kv_config/kv_config.h"
29-
#include "kvstore/TDBStore.h"
29+
#include "tdbstore/TDBStore.h"
3030
#include "FlashIAP.h"
3131
#include "FlashIAPBlockDevice.h"
3232
#include "direct_access_devicekey/DirectAccessDevicekey.h"

0 commit comments

Comments
 (0)