mirror of
https://github.com/apache/nuttx.git
synced 2026-08-06 21:19:03 +00:00
cmake: fix installed application binaries to match Application.mk
Match the Application.mk install rule: keep the application attribute symbols (nx_stacksize etc.) through strip as NX_KEEP does, and mark the installed binaries executable, since ld -r output is not and filesystem images built from bin/ refuse to exec. Signed-off-by: raiden00pl <raiden00@railab.me> Assisted-by: Claude Code
This commit is contained in:
parent
3e142bbced
commit
b5dccf4fe3
1 changed files with 9 additions and 1 deletions
|
|
@ -199,7 +199,15 @@ function(nuttx_add_application)
|
|||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/bin_debug/${ELF_NAME}
|
||||
${CMAKE_BINARY_DIR}/bin/${ELF_NAME}
|
||||
COMMAND ${CMAKE_STRIP} ${CMAKE_BINARY_DIR}/bin/${ELF_NAME}
|
||||
# keep the application attribute symbols through strip so the binary
|
||||
# loader can still read them, see NX_KEEP in Application.mk
|
||||
COMMAND
|
||||
${CMAKE_STRIP} -K nx_stacksize -K nx_priority -K nx_uid -K nx_gid -K
|
||||
nx_mode ${CMAKE_BINARY_DIR}/bin/${ELF_NAME}
|
||||
# match the Application.mk install rule: ld -r output is not marked
|
||||
# executable, but filesystem images built from bin/ must carry the
|
||||
# execute permission
|
||||
COMMAND chmod +x ${CMAKE_BINARY_DIR}/bin/${ELF_NAME}
|
||||
COMMENT "Building ELF:${ELF_NAME}"
|
||||
COMMAND_EXPAND_LISTS)
|
||||
else()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue