diff --git a/CMakeLists.txt b/CMakeLists.txt index 80f03424ad..0364cc8bcf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -688,16 +688,28 @@ else() list(APPEND nuttx_libs_paths $) endforeach() - add_custom_command( - OUTPUT nuttx.rel - COMMAND - ${CMAKE_C_COMPILER} ARGS -r $<$:-m32> - $ $<$>:-Wl,--start-group> - ${nuttx_libs_paths} ${nuttx_extra_libs} - $<$>:-Wl,--end-group> -o nuttx.rel - COMMAND ${CMAKE_OBJCOPY} --redefine-syms=nuttx-names.dat nuttx.rel - DEPENDS ${nuttx_libs} ${nuttx_extra_libs} sim_head - COMMAND_EXPAND_LISTS) + if(APPLE) + add_custom_command( + OUTPUT nuttx.rel + COMMAND + ${CMAKE_C_COMPILER} ARGS -r $<$:-m32> + $ $<$>:-Wl,--start-group> + ${nuttx_libs_paths} ${nuttx_extra_libs} + $<$>:-Wl,--end-group> -o nuttx.rel + DEPENDS ${nuttx_libs} ${nuttx_extra_libs} sim_head + COMMAND_EXPAND_LISTS) + else() + add_custom_command( + OUTPUT nuttx.rel + COMMAND + ${CMAKE_C_COMPILER} ARGS -r $<$:-m32> + $ $<$>:-Wl,--start-group> + ${nuttx_libs_paths} ${nuttx_extra_libs} + $<$>:-Wl,--end-group> -o nuttx.rel + COMMAND ${CMAKE_OBJCOPY} --redefine-syms=nuttx-names.dat nuttx.rel + DEPENDS ${nuttx_libs} ${nuttx_extra_libs} sim_head + COMMAND_EXPAND_LISTS) + endif() add_custom_target(nuttx-rel DEPENDS nuttx.rel $<$>:nuttx.ld>)