mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 19:36:35 +08:00
cmake: do not run objcopy for macOS
The mach-o support of objcopy is fragile at best and often results in a broken output. It's better not to rely on it. This matches what the non-cmake version does.
This commit is contained in:
committed by
Xiang Xiao
parent
1adfc1ae79
commit
e0c4e292bf
+22
-10
@@ -688,16 +688,28 @@ else()
|
|||||||
list(APPEND nuttx_libs_paths $<TARGET_FILE:${lib}>)
|
list(APPEND nuttx_libs_paths $<TARGET_FILE:${lib}>)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
add_custom_command(
|
if(APPLE)
|
||||||
OUTPUT nuttx.rel
|
add_custom_command(
|
||||||
COMMAND
|
OUTPUT nuttx.rel
|
||||||
${CMAKE_C_COMPILER} ARGS -r $<$<BOOL:${CONFIG_SIM_M32}>:-m32>
|
COMMAND
|
||||||
$<TARGET_OBJECTS:sim_head> $<$<NOT:$<BOOL:${APPLE}>>:-Wl,--start-group>
|
${CMAKE_C_COMPILER} ARGS -r $<$<BOOL:${CONFIG_SIM_M32}>:-m32>
|
||||||
${nuttx_libs_paths} ${nuttx_extra_libs}
|
$<TARGET_OBJECTS:sim_head> $<$<NOT:$<BOOL:${APPLE}>>:-Wl,--start-group>
|
||||||
$<$<NOT:$<BOOL:${APPLE}>>:-Wl,--end-group> -o nuttx.rel
|
${nuttx_libs_paths} ${nuttx_extra_libs}
|
||||||
COMMAND ${CMAKE_OBJCOPY} --redefine-syms=nuttx-names.dat nuttx.rel
|
$<$<NOT:$<BOOL:${APPLE}>>:-Wl,--end-group> -o nuttx.rel
|
||||||
DEPENDS ${nuttx_libs} ${nuttx_extra_libs} sim_head
|
DEPENDS ${nuttx_libs} ${nuttx_extra_libs} sim_head
|
||||||
COMMAND_EXPAND_LISTS)
|
COMMAND_EXPAND_LISTS)
|
||||||
|
else()
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT nuttx.rel
|
||||||
|
COMMAND
|
||||||
|
${CMAKE_C_COMPILER} ARGS -r $<$<BOOL:${CONFIG_SIM_M32}>:-m32>
|
||||||
|
$<TARGET_OBJECTS:sim_head> $<$<NOT:$<BOOL:${APPLE}>>:-Wl,--start-group>
|
||||||
|
${nuttx_libs_paths} ${nuttx_extra_libs}
|
||||||
|
$<$<NOT:$<BOOL:${APPLE}>>:-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
|
add_custom_target(nuttx-rel DEPENDS nuttx.rel
|
||||||
$<$<NOT:$<BOOL:${APPLE}>>:nuttx.ld>)
|
$<$<NOT:$<BOOL:${APPLE}>>:nuttx.ld>)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user