modules: Add zcbor Kconfig and cmake recipe

The commit adds files for the zcbor to be built as module.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This commit is contained in:
Dominik Ermel 2022-03-01 16:24:03 +00:00 committed by Carles Cufí
parent 2dfb883158
commit 22c32cfbb4
3 changed files with 26 additions and 0 deletions

View file

@ -32,6 +32,7 @@ source "modules/Kconfig.tinycbor"
source "modules/Kconfig.tinycrypt"
source "modules/Kconfig.vega"
source "modules/Kconfig.xtensa"
source "modules/zcbor/Kconfig"
source "modules/Kconfig.mcuboot_bootutil"
comment "Unavailable modules, please install those via the project manifest."
@ -80,6 +81,9 @@ comment "CANopenNode module not available."
comment "FFF module not available."
depends on !ZEPHYR_FFF_MODULE
comment "zcbor module not available."
depends on !ZEPHYR_ZCBOR_MODULE
# This ensures that symbols are available in Kconfig for dependency checking
# and referencing, while keeping the settings themselves unavailable when the
# modules are not present in the workspace

View file

@ -0,0 +1,12 @@
if(CONFIG_ZCBOR)
zephyr_include_directories(
${ZEPHYR_ZCBOR_MODULE_DIR}/include
)
zephyr_library()
zephyr_library_sources(
${ZEPHYR_ZCBOR_MODULE_DIR}/src/zcbor_common.c
${ZEPHYR_ZCBOR_MODULE_DIR}/src/zcbor_decode.c
${ZEPHYR_ZCBOR_MODULE_DIR}/src/zcbor_encode.c
)
endif()

10
modules/zcbor/Kconfig Normal file
View file

@ -0,0 +1,10 @@
# Copyright (c) 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
config ZEPHYR_ZCBOR_MODULE
bool
config ZCBOR
bool "zcbor library"
help
Enable zcbor CBOR encoder/decoder library