-
Notifications
You must be signed in to change notification settings - Fork 39
/
CMakeLists.txt
61 lines (52 loc) · 1.55 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#
# Copyright (c) 2020 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
#
cmake_minimum_required(VERSION 3.13.1)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(test3_simple)
include(../../cmake/test_template.cmake)
target_sources(app PRIVATE
../../fuzz/fuzz_pet.c)
set(py_command_pet
zcbor
code
-c ${CMAKE_CURRENT_LIST_DIR}/../../cases/pet.cddl
--output-cmake ${PROJECT_BINARY_DIR}/pet.cmake
-t Pet
-d
${bit_arg}
--short-names
--file-header "Copyright (c) 2020 Nordic Semiconductor ASA\n\nSPDX-License-Identifier: Apache-2.0"
)
set(py_command_serial_recovery
zcbor
code
-c ${CMAKE_CURRENT_LIST_DIR}/../../cases/serial_recovery.cddl
--oh ${PROJECT_BINARY_DIR}/include/serial/serial_recovery_decode.h
--oht ${PROJECT_BINARY_DIR}/include/serial/serial_recovery_decode_types.h
--oc ${PROJECT_BINARY_DIR}/src/serial/serial_recovery_decode.c
-t Upload
-d
${bit_arg}
--short-names
# Testing the --include-prefix option
--include-prefix serial
)
execute_process(
COMMAND ${py_command_pet}
COMMAND_ERROR_IS_FATAL ANY
)
execute_process(
COMMAND ${py_command_serial_recovery}
COMMAND_ERROR_IS_FATAL ANY
)
include(${PROJECT_BINARY_DIR}/pet.cmake)
FILE(GLOB build_sources ${CMAKE_CURRENT_LIST_DIR}/../../../src/*.c)
zephyr_include_directories(${PROJECT_BINARY_DIR}/include
${CMAKE_CURRENT_LIST_DIR}/../../../include)
zephyr_sources(${PROJECT_BINARY_DIR}/src/serial/serial_recovery_decode.c
${build_sources})
target_link_libraries(pet PRIVATE zephyr_interface)
target_link_libraries(app PRIVATE pet)