1#
2# Copyright (c) 2022 Nordic Semiconductor ASA
3#
4# SPDX-License-Identifier: Apache-2.0
5#
6
7cmake_minimum_required(VERSION 3.13.1)
8
9set_property(GLOBAL PROPERTY CSTD c11) # To avoid issues with c99 and -Wpedantic
10
11find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
12project(test4_senml)
13include(../../cmake/test_template.cmake)
14
15set(py_command
16  zcbor
17  code
18  -c ${CMAKE_CURRENT_LIST_DIR}/../../cases/senml.cddl
19  --output-cmake ${PROJECT_BINARY_DIR}/senml.cmake
20  -t lwm2m_senml
21  -e
22  ${bit_arg}
23  )
24
25execute_process(
26  COMMAND ${py_command}
27  COMMAND_ERROR_IS_FATAL ANY
28  )
29
30include(${PROJECT_BINARY_DIR}/senml.cmake)
31
32target_link_libraries(senml PRIVATE zephyr_interface)
33target_link_libraries(app PRIVATE senml)
34
35if (NOT VERBOSE)
36  # VERBOSE means including printk which doesn't build with these options.
37  target_compile_options(senml PRIVATE -Wpedantic -Wconversion)
38endif()
39