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.git


The following commit(s) were added to refs/heads/master by this push:
     new c4017a4b22 cmake/romfs: separate c flags to avoid compile fail
c4017a4b22 is described below

commit c4017a4b22301af86e421771a22c4f4ac77421eb
Author: chao an <[email protected]>
AuthorDate: Thu May 9 20:00:11 2024 +0800

    cmake/romfs: separate c flags to avoid compile fail
    
    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 <[email protected]>
---
 cmake/nuttx_add_romfs.cmake | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cmake/nuttx_add_romfs.cmake b/cmake/nuttx_add_romfs.cmake
index e844357a1b..e600341acc 100644
--- a/cmake/nuttx_add_romfs.cmake
+++ b/cmake/nuttx_add_romfs.cmake
@@ -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})

Reply via email to