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(sockets_echo_client_self_test) 7 8if(CONFIG_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED AND 9 (CONFIG_NET_SAMPLE_PSK_HEADER_FILE STREQUAL "dummy_psk.h")) 10 add_custom_target(development_psk 11 COMMAND ${CMAKE_COMMAND} -E echo "----------------------------------------------------------" 12 COMMAND ${CMAKE_COMMAND} -E echo "--- WARNING: Using dummy PSK! Only suitable for ---" 13 COMMAND ${CMAKE_COMMAND} -E echo "--- development. Set NET_SAMPLE_PSK_HEADER_FILE to use ---" 14 COMMAND ${CMAKE_COMMAND} -E echo "--- own pre-shared key. ---" 15 COMMAND ${CMAKE_COMMAND} -E echo "----------------------------------------------------------" 16 ) 17 add_dependencies(app development_psk) 18endif() 19 20set(echo_client_path ${ZEPHYR_BASE}/samples/net/sockets/echo_client) 21 22target_include_directories(app PRIVATE ${echo_client_path}/src/) 23 24target_sources(app PRIVATE 25 src/echo_test.c 26 src/test_main.c 27) 28 29target_sources( app PRIVATE ${echo_client_path}/src/echo-client.c) 30target_sources_ifdef(CONFIG_NET_UDP app PRIVATE ${echo_client_path}/src/udp.c) 31target_sources_ifdef(CONFIG_NET_TCP app PRIVATE ${echo_client_path}/src/tcp.c) 32target_sources_ifdef(CONFIG_NET_VLAN app PRIVATE ${echo_client_path}/src/vlan.c) 33 34include(${ZEPHYR_BASE}/samples/net/common/common.cmake) 35 36set(gen_dir ${ZEPHYR_BINARY_DIR}/include/generated/) 37 38generate_inc_file_for_target( 39 app 40 ${echo_client_path}/src/echo-apps-cert.der 41 ${gen_dir}/echo-apps-cert.der.inc 42 ) 43 44zephyr_include_directories( 45 ${BSIM_COMPONENTS_PATH}/libUtilv1/src/ 46 ${BSIM_COMPONENTS_PATH}/libPhyComv1/src/ 47 ) 48