Skip to content

Commit b03483b

Browse files
committed
make this repo a zephyr module
Add zephyr/module.yaml and cmake/kconfig to integrate this repo as a module in a multi-repo setup of Zephyr. Signed-off-by: Anas Nashif <[email protected]>
1 parent 3ef9fed commit b03483b

File tree

3 files changed

+97
-0
lines changed

3 files changed

+97
-0
lines changed

CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
zephyr_interface_library_named(TINYCBOR)
2+
3+
target_include_directories(TINYCBOR INTERFACE src)
4+
5+
zephyr_library()
6+
zephyr_library_sources(
7+
src/cbor_buf_reader.c
8+
src/cbor_buf_writer.c
9+
src/cborencoder.c
10+
src/cborerrorstrings.c
11+
src/cborparser.c
12+
)
13+
zephyr_library_sources_ifdef(CONFIG_NEWLIB_LIBC src/cborparser_dup_string.c)
14+
15+
zephyr_library_sources_ifdef(CONFIG_CBOR_PRETTY_PRINTING src/cborpretty.c)
16+
17+
zephyr_library_link_libraries(TINYCBOR)
18+
target_link_libraries(TINYCBOR INTERFACE zephyr_interface)

Kconfig.tinycbor

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
config TINYCBOR
21+
bool "tinyCBOR Support"
22+
help
23+
This option enables the tinyCBOR library.
24+
25+
if TINYCBOR
26+
27+
config CBOR_NO_DFLT_WRITER
28+
bool "No default writer support"
29+
help
30+
This option specifies whether a default writer exists.
31+
32+
config CBOR_NO_DFLT_READER
33+
bool "No default reader support"
34+
help
35+
This option specifies whether a default reader exists.
36+
37+
config CBOR_ENCODER_NO_CHECK_USER
38+
bool "No encoder checks for user args for validity"
39+
help
40+
This option specifies whether a check user exists for a cbor encoder.
41+
42+
config CBOR_PARSER_MAX_RECURSIONS
43+
int "Parser max recursions"
44+
default 1024
45+
help
46+
This option specifies max recursions for the parser.
47+
48+
config CBOR_PARSER_NO_STRICT_CHECKS
49+
bool "No strict parser checks"
50+
help
51+
This option enables the strict parser checks.
52+
53+
config CBOR_FLOATING_POINT
54+
bool "Floating point support"
55+
select NEWLIB_LIBC
56+
help
57+
This option enables floating point support.
58+
59+
config CBOR_HALF_FLOAT_TYPE
60+
bool "Half float type support"
61+
select NEWLIB_LIBC
62+
help
63+
This option enables half float type support.
64+
65+
config CBOR_WITHOUT_OPEN_MEMSTREAM
66+
bool "Without open memstream"
67+
default y
68+
help
69+
This option enables open memstream support.
70+
71+
config CBOR_PRETTY_PRINTING
72+
bool "Implement pretty printing functionality"
73+
help
74+
This option enables cbor_value_to_pretty_stream function.
75+
76+
endif #TINYCBOR

zephyr/module.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build:
2+
cmake: .
3+
kconfig: Kconfig.tinycbor

0 commit comments

Comments
 (0)