zephyr/samples/net/zperf/CMakeLists.txt
Daniel DeGrasse 68952095a5 samples: net: zperf: allow networking code to be relocated to RAM
Enable relocation of key networking stack functions to RAM when running
the zperf example. This will enable better performance on platforms with
fast code RAM.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-01-26 12:57:02 +01:00

25 lines
788 B
CMake

# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(zperf)
target_sources(app PRIVATE
src/main.c
)
if (CONFIG_NET_SAMPLE_CODE_RELOCATE)
# Relocate key networking stack components and L2 layer to RAM
zephyr_code_relocate(LIBRARY subsys__net__ip
LOCATION "${CONFIG_NET_SAMPLE_CODE_RAM_NAME}_TEXT" NOKEEP)
zephyr_code_relocate(LIBRARY subsys__net
LOCATION "${CONFIG_NET_SAMPLE_CODE_RAM_NAME}_TEXT" NOKEEP)
if (CONFIG_NET_L2_ETHERNET)
zephyr_code_relocate(LIBRARY drivers__ethernet
LOCATION "${CONFIG_NET_SAMPLE_CODE_RAM_NAME}_TEXT" NOKEEP)
zephyr_code_relocate(LIBRARY subsys__net__l2__ethernet
LOCATION "${CONFIG_NET_SAMPLE_CODE_RAM_NAME}_TEXT" NOKEEP)
endif()
endif()