Skip to content

Commit

Permalink
cmake/romfs: separate c flags to avoid compile fail
Browse files Browse the repository at this point in the history
riscv-none-elf-gcc: warning:  -Wstrict-prototypes: linker input file unused because linking not done
riscv-none-elf-gcc: error:  -Wstrict-prototypes: linker input file not found: No such file or directory

Signed-off-by: chao an <anchao@lixiang.com>
  • Loading branch information
anchao committed May 9, 2024
1 parent 8eadde8 commit 11f55e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmake/nuttx_add_romfs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ function(nuttx_add_romfs)

foreach(rcsrc ${RCSRCS})
get_filename_component(rcpath ${rcsrc} DIRECTORY)
separate_arguments(CMAKE_C_FLAG_ARGS NATIVE_COMMAND ${CMAKE_C_FLAGS})
add_custom_command(
OUTPUT ${rcsrc}
COMMAND ${CMAKE_COMMAND} -E make_directory ${rcpath}
COMMAND
${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} -E -P -x c
${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} -E -P -x c
-I${CMAKE_BINARY_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/${rcsrc} >
${rcsrc}
DEPENDS nuttx_context ${CMAKE_CURRENT_SOURCE_DIR}/${rcsrc})
Expand Down

0 comments on commit 11f55e8

Please sign in to comment.