From 7bab630e72298b954c1c0d07d5c24bce6c79de28 Mon Sep 17 00:00:00 2001 From: xuxin19 Date: Fri, 1 Nov 2024 21:34:01 +0800 Subject: [PATCH] sotest:implement cmake sotest when kernel build does not support yet Signed-off-by: xuxin19 --- examples/sotest/main/CMakeLists.txt | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/examples/sotest/main/CMakeLists.txt b/examples/sotest/main/CMakeLists.txt index 3e059d9849..de0fdd249d 100644 --- a/examples/sotest/main/CMakeLists.txt +++ b/examples/sotest/main/CMakeLists.txt @@ -19,5 +19,27 @@ # ############################################################################## if(CONFIG_EXAMPLES_SOTEST) - nuttx_add_application(NAME sotest) + + # FIXME: fix all empty a after the kernel build is implemented + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sotest_symtab.c + COMMAND + ${NUTTX_APPS_DIR}/tools/mksymtab.sh ${CMAKE_CURRENT_BINARY_DIR}/empty + g_sot > ${CMAKE_CURRENT_BINARY_DIR}/sotest_symtab.c) + + add_custom_target( + sotest_romfs + COMMAND genromfs -f sotest_romfs.img -d empty + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + + add_custom_command( + OUTPUT sotest_romfs.c + COMMAND xxd -i sotest_romfs.img > sotest_romfs.c + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS sotest_romfs) + + nuttx_add_application( + NAME sotest SRCS sotest_main.c ${CMAKE_CURRENT_BINARY_DIR}/sotest_symtab.c + ${CMAKE_CURRENT_BINARY_DIR}/sotest_romfs.c) + endif()