llext: move current test to a hello_world subdir
In preparation for multiple tests, move the current hello_world test to its own subdirectory. Also, merge the llext compilation in the parent CMakeLists.txt. Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This commit is contained in:
parent
92a5e3ace7
commit
938d3547d0
|
@ -1,26 +0,0 @@
|
|||
# Copyright (c) 2023 Intel Corporation.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
cmake_minimum_required(VERSION 3.20.0)
|
||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||
project(llext_test)
|
||||
|
||||
add_subdirectory(hello_world)
|
||||
|
||||
target_sources(app PRIVATE src/test_llext_simple.c)
|
||||
|
||||
target_include_directories(app PRIVATE
|
||||
${ZEPHYR_BASE}/include
|
||||
${ZEPHYR_BASE}/kernel/include
|
||||
${ZEPHYR_BASE}/arch/${ARCH}/include
|
||||
)
|
||||
|
||||
set(gen_dir ${ZEPHYR_BINARY_DIR}/include/generated/)
|
||||
|
||||
generate_inc_file_for_target(
|
||||
app
|
||||
${HELLO_WORLD_LLEXT}
|
||||
${gen_dir}/hello_world.inc
|
||||
)
|
||||
|
||||
add_dependencies(app hello_world)
|
|
@ -3,20 +3,26 @@
|
|||
|
||||
cmake_minimum_required(VERSION 3.20.0)
|
||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||
project(hello_world)
|
||||
project(llext_hello_world_test)
|
||||
|
||||
if(NOT CONFIG_LLEXT_TEST_HELLO)
|
||||
# test disabled, nothing to do
|
||||
else()
|
||||
target_sources(app PRIVATE
|
||||
src/test/test_llext_simple.c
|
||||
)
|
||||
|
||||
set(llext_src_file ${PROJECT_SOURCE_DIR}/hello_world.c)
|
||||
set(llext_bin_file ${PROJECT_BINARY_DIR}/hello_world.llext)
|
||||
target_include_directories(app PRIVATE
|
||||
${ZEPHYR_BASE}/include
|
||||
${ZEPHYR_BASE}/kernel/include
|
||||
${ZEPHYR_BASE}/arch/${ARCH}/include
|
||||
)
|
||||
|
||||
add_llext_target(hello_world
|
||||
OUTPUT ${llext_bin_file}
|
||||
SOURCES ${llext_src_file}
|
||||
)
|
||||
# Compile a simple hello world llext to an include file
|
||||
set(llext_src_file ${PROJECT_SOURCE_DIR}/src/llext/hello_world.c)
|
||||
set(llext_bin_file ${ZEPHYR_BINARY_DIR}/hello_world.llext)
|
||||
set(llext_inc_file ${ZEPHYR_BINARY_DIR}/include/generated/hello_world.inc)
|
||||
|
||||
set(HELLO_WORLD_LLEXT ${llext_bin_file} PARENT_SCOPE)
|
||||
add_llext_target(hello_world
|
||||
OUTPUT ${llext_bin_file}
|
||||
SOURCES ${llext_src_file}
|
||||
)
|
||||
|
||||
endif()
|
||||
generate_inc_file_for_target(app ${llext_bin_file} ${llext_inc_file})
|
||||
|
|
Loading…
Reference in a new issue