You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/11/03 01:22:42 UTC

(nuttx-apps) 02/02: sotest:implement cmake sotest when kernel build does not support yet

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 7bab630e72298b954c1c0d07d5c24bce6c79de28
Author: xuxin19 <xu...@xiaomi.com>
AuthorDate: Fri Nov 1 21:34:01 2024 +0800

    sotest:implement cmake sotest when kernel build does not support yet
    
    Signed-off-by: xuxin19 <xu...@xiaomi.com>
---
 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 3e059d984..de0fdd249 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()