CMake: Add Blockdevice dependency to KVstore library

As KVstore relies on BlockDevice add the dependency
in Mbed OS so applications do not have to specify it
pull/14079/head
Hugues Kamba 2020-12-21 13:57:52 +00:00
parent 994662ab5f
commit 69b4c13761
1 changed files with 29 additions and 0 deletions

View File

@ -15,7 +15,36 @@ target_include_directories(mbed-storage-kvstore
include/kvstore include/kvstore
) )
if("DATAFLASH" IN_LIST MBED_TARGET_LABELS)
list(APPEND mbed_blockdevice_libs mbed-storage-dataflash)
endif()
if("FLASHIAP" IN_LIST MBED_TARGET_LABELS)
list(APPEND mbed_blockdevice_libs mbed-storage-flashiap)
endif()
if("I2CEE" IN_LIST MBED_TARGET_LABELS)
list(APPEND mbed_blockdevice_libs mbed-storage-i2cee)
endif()
if("OSPIF" IN_LIST MBED_TARGET_LABELS)
list(APPEND mbed_blockdevice_libs mbed-storage-ospif)
endif()
if("QSPIF" IN_LIST MBED_TARGET_LABELS)
list(APPEND mbed_blockdevice_libs mbed-storage-qspif)
endif()
if("SD" IN_LIST MBED_TARGET_LABELS)
list(APPEND mbed_blockdevice_libs mbed-storage-sd)
endif()
if("SPIF" IN_LIST MBED_TARGET_LABELS)
list(APPEND mbed_blockdevice_libs mbed-storage-spif)
endif()
target_link_libraries(mbed-storage-kvstore target_link_libraries(mbed-storage-kvstore
INTERFACE INTERFACE
mbed-storage-kv-global-api mbed-storage-kv-global-api
${mbed_blockdevice_libs}
) )