Move find of STRIP_TOOL to toolchain

Signed-off-by: Nicolae Rosia <nicolae.rosia@gmail.com>
This commit is contained in:
Nicolae Rosia 2017-05-31 21:57:50 +03:00 committed by Lorenz Meier
parent a50a87928f
commit 3dd32492de
2 changed files with 3 additions and 3 deletions

View File

@ -18,6 +18,8 @@ foreach(tool echo grep rm mkdir nm cp touch make unzip)
endif()
endforeach()
FIND_PROGRAM(STRIP_TOOL "arm-linux-gnueabihf-strip")
set(CMAKE_EXE_LINKER_FLAGS "-Wl,-gc-sections")
#set(CMAKE_C_FLAGS ${C_FLAGS})
#set(CMAKE_CXX_LINKER_FLAGS ${C_FLAGS})

View File

@ -140,14 +140,12 @@ install(TARGETS px4 DESTINATION ${CMAKE_INSTALL_BINDIR})
install(DIRECTORY ${PROJECT_SOURCE_DIR}/ROMFS DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME})
install(DIRECTORY ${PROJECT_SOURCE_DIR}/posix-configs DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME})
FIND_PROGRAM(STRIP_TOOL "arm-linux-gnueabihf-strip")
add_custom_target(strip
DEPENDS px4.stripped
)
add_custom_command(OUTPUT px4.stripped
COMMAND arm-linux-gnueabihf-strip -R .comment -R .gnu.version $<TARGET_FILE:px4>
COMMAND ${STRIP_TOOL} -R .comment -R .gnu.version $<TARGET_FILE:px4>
DEPENDS px4)
# vim: set noet ft=cmake fenc=utf-8 ff=unix :