Skip to content

Commit 7bab630

Browse files
xuxin930xiaoxiang781216
authored andcommitted
sotest:implement cmake sotest when kernel build does not support yet
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
1 parent 90f2a33 commit 7bab630

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

examples/sotest/main/CMakeLists.txt

+23-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,27 @@
1919
# ##############################################################################
2020

2121
if(CONFIG_EXAMPLES_SOTEST)
22-
nuttx_add_application(NAME sotest)
22+
23+
# FIXME: fix all empty a after the kernel build is implemented
24+
add_custom_command(
25+
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sotest_symtab.c
26+
COMMAND
27+
${NUTTX_APPS_DIR}/tools/mksymtab.sh ${CMAKE_CURRENT_BINARY_DIR}/empty
28+
g_sot > ${CMAKE_CURRENT_BINARY_DIR}/sotest_symtab.c)
29+
30+
add_custom_target(
31+
sotest_romfs
32+
COMMAND genromfs -f sotest_romfs.img -d empty
33+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
34+
35+
add_custom_command(
36+
OUTPUT sotest_romfs.c
37+
COMMAND xxd -i sotest_romfs.img > sotest_romfs.c
38+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
39+
DEPENDS sotest_romfs)
40+
41+
nuttx_add_application(
42+
NAME sotest SRCS sotest_main.c ${CMAKE_CURRENT_BINARY_DIR}/sotest_symtab.c
43+
${CMAKE_CURRENT_BINARY_DIR}/sotest_romfs.c)
44+
2345
endif()

0 commit comments

Comments
 (0)