1# SPDX-License-Identifier: Apache-2.0
2
3cmake_minimum_required(VERSION 3.20.0)
4
5find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
6project(bsim_test_mesh)
7
8target_sources(app PRIVATE
9 src/main.c
10 src/mesh_test.c
11 src/friendship_common.c
12 src/gatt_common.c
13 src/dfu_blob_common.c
14)
15
16if(CONFIG_SETTINGS)
17
18 target_sources(app PRIVATE
19  src/test_persistence.c
20  src/test_replay_cache.c
21  src/test_provision.c
22  src/test_dfu.c
23  src/test_blob.c
24  src/test_sar.c
25  src/test_lcd.c
26)
27
28if(CONFIG_BT_MESH_USES_MBEDTLS_PSA)
29 target_sources(app PRIVATE
30  src/distribute_keyid.c
31  src/psa_its_emul.c
32 )
33endif()
34
35if(CONFIG_BT_MESH_GATT_PROXY AND CONFIG_BT_MESH_PROXY_SOLICITATION)
36 target_sources(app PRIVATE
37  src/test_proxy_sol.c
38 )
39endif()
40
41elseif(CONFIG_BT_MESH_GATT_PROXY)
42
43 target_sources(app PRIVATE
44  src/test_advertiser.c
45  src/test_suspend.c
46  src/test_beacon.c
47 )
48
49elseif(CONFIG_BT_CTLR_LOW_LAT)
50
51 target_sources(app PRIVATE
52  src/test_friendship.c
53  src/test_transport.c
54  src/test_suspend.c
55  src/test_advertiser.c
56 )
57
58else()
59
60 target_sources(app PRIVATE
61  src/test_transport.c
62  src/test_friendship.c
63  src/test_provision.c
64  src/test_beacon.c
65  src/test_scanner.c
66  src/test_heartbeat.c
67  src/test_access.c
68  src/test_iv_index.c
69  src/test_advertiser.c
70  src/test_suspend.c
71  src/test_blob.c
72  src/test_op_agg.c
73  src/test_sar.c
74  src/test_cdp1.c
75 )
76
77endif()
78
79zephyr_include_directories(
80  ${BSIM_COMPONENTS_PATH}/libUtilv1/src/
81  ${BSIM_COMPONENTS_PATH}/libPhyComv1/src/
82)
83
84# The mbedTLS PSA ITS is not thread safe.
85# The issue: https://github.com/zephyrproject-rtos/zephyr/issues/59362
86# Also, it isn't possible to use "native" ITS implementation since
87# mbedTLS includes headers that do not exist.
88# This linker option allows linking custom ITS implementation instead of
89# precompiled objects from the mbedTLS library to run it in parallel.
90if(CONFIG_BT_MESH_USES_MBEDTLS_PSA)
91  zephyr_ld_options(
92    ${LINKERFLAGPREFIX},--allow-multiple-definition
93    )
94endif()
95