1# SPDX-License-Identifier: Apache-2.0
2
3cmake_minimum_required(VERSION 3.20.0)
4find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
5project(lwm2m_engine_test)
6
7set(APP_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
8
9# Add test sources
10target_sources(app PRIVATE ${APP_SRC_DIR}/main.c)
11target_sources(app PRIVATE ${APP_SRC_DIR}/stubs.c)
12target_sources(app PRIVATE ${ZEPHYR_BASE}/subsys/net/lib/lwm2m/lwm2m_engine.c)
13zephyr_linker_sources(SECTIONS ${ZEPHYR_BASE}/subsys/net/lib/lwm2m/iterables.ld)
14
15# Add includes directories
16target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
17target_include_directories(app PRIVATE ${ZEPHYR_BASE}/include/)
18target_include_directories(app PRIVATE ${ZEPHYR_BASE}/subsys/net/lib/lwm2m/)
19target_include_directories(app PRIVATE ${ZEPHYR_BASE}/../modules/crypto/mbedtls/include/)
20
21add_compile_definitions(CONFIG_LWM2M_ENGINE_MAX_PENDING=2)
22add_compile_definitions(CONFIG_LWM2M_ENGINE_MAX_REPLIES=2)
23add_compile_definitions(CONFIG_LWM2M_ENGINE_VALIDATION_BUFFER_SIZE=512)
24add_compile_definitions(CONFIG_LWM2M_ENGINE_MESSAGE_HEADER_SIZE=512)
25add_compile_definitions(CONFIG_LWM2M_ENGINE_MAX_OBSERVER=10)
26add_compile_definitions(CONFIG_LWM2M_ENGINE_STACK_SIZE=2048)
27add_compile_definitions(CONFIG_LWM2M_NUM_BLOCK1_CONTEXT=3)
28add_compile_definitions(CONFIG_LWM2M_COAP_BLOCK_SIZE=256)
29add_compile_definitions(CONFIG_LWM2M_COAP_MAX_MSG_SIZE=512)
30add_compile_definitions(CONFIG_LWM2M_ENGINE_DEFAULT_LIFETIME=60)
31add_compile_definitions(CONFIG_LWM2M_SECURITY_INSTANCE_COUNT=1)
32add_compile_definitions(CONFIG_LWM2M_SECONDS_TO_UPDATE_EARLY=30)
33add_compile_definitions(CONFIG_LWM2M_QUEUE_MODE_UPTIME=30)
34add_compile_definitions(CONFIG_LWM2M_LOG_LEVEL=4)
35add_compile_definitions(CONFIG_ZVFS_POLL_MAX=3)
36add_compile_definitions(CONFIG_LWM2M_DTLS_SUPPORT)
37add_compile_definitions(CONFIG_LWM2M_QUEUE_MODE_ENABLED)
38add_compile_definitions(CONFIG_TLS_CREDENTIALS)
39add_compile_definitions(CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP)
40