Merge pull request 'create unique bin name again' (#143) from mueller/create-unique-bin-name into develop
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

Reviewed-on: #143
Reviewed-by: Jakob.Meier <meierj@irs.uni-stuttgart.de>
This commit is contained in:
Jakob Meier 2022-02-22 18:15:11 +01:00
commit 7a97471ed9
2 changed files with 19 additions and 6 deletions

View File

@ -17,13 +17,19 @@ option(EIVE_BUILD_UNITTESTS "Build Catch2 unittests" OFF)
option(EIVE_ADD_ETL_LIB "Add ETL library" ON) option(EIVE_ADD_ETL_LIB "Add ETL library" ON)
option(EIVE_ADD_JSON_LIB "Add JSON library" ON) option(EIVE_ADD_JSON_LIB "Add JSON library" ON)
option(EIVE_SYSROOT_MAGIC "Perform sysroot magic which might not be necessary" OFF) option(EIVE_SYSROOT_MAGIC "Perform sysroot magic which might not be necessary" OFF)
option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" ON)
if(NOT FSFW_OSAL) if(NOT FSFW_OSAL)
set(FSFW_OSAL linux CACHE STRING "OS for the FSFW.") set(FSFW_OSAL linux CACHE STRING "OS for the FSFW.")
endif() endif()
if(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack") if(TGT_BSP)
option(LINUX_CROSS_COMPILE ON) if(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack")
option(LINUX_CROSS_COMPILE ON)
option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" OFF)
elseif(TGT_BSP MATCHES "arm/q7s")
option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" ON)
endif()
endif() endif()
# Perform steps like loading toolchain files where applicable. # Perform steps like loading toolchain files where applicable.
@ -160,7 +166,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
"-Wno-unused-parameter" "-Wno-unused-parameter"
"-Wno-psabi" "-Wno-psabi"
) )
message(STATUS "goes here")
# Remove unused sections. # Remove unused sections.
add_compile_options( add_compile_options(
"-ffunction-sections" "-ffunction-sections"
@ -182,6 +188,12 @@ add_library(${LIB_EIVE_MISSION})
# Add executable # Add executable
add_executable(${OBSW_NAME}) add_executable(${OBSW_NAME})
if(EIVE_CREATE_UNIQUE_OBSW_BIN)
set(OBSW_BIN_NAME ${CMAKE_PROJECT_NAME}-$ENV{USERNAME})
else()
set(OBSW_BIN_NAME ${CMAKE_PROJECT_NAME})
endif()
set_target_properties(${OBSW_NAME} PROPERTIES OUTPUT_NAME ${OBSW_BIN_NAME})
#watchdog #watchdog
add_executable(${WATCHDOG_NAME} EXCLUDE_FROM_ALL) add_executable(${WATCHDOG_NAME} EXCLUDE_FROM_ALL)
@ -336,9 +348,10 @@ string(CONCAT POST_BUILD_COMMENT
add_custom_command( add_custom_command(
TARGET ${OBSW_NAME} TARGET ${OBSW_NAME}
POST_BUILD POST_BUILD
COMMAND ${CMAKE_SIZE} ${OBSW_NAME}${FILE_SUFFIX} COMMAND ${CMAKE_SIZE} ${OBSW_BIN_NAME}${FILE_SUFFIX}
COMMENT ${POST_BUILD_COMMENT} COMMENT ${POST_BUILD_COMMENT}
) )
include (${CMAKE_SCRIPT_PATH}/BuildType.cmake) include (${CMAKE_SCRIPT_PATH}/BuildType.cmake)
set_build_type() set_build_type()

View File

@ -41,12 +41,12 @@ add_compile_options(
$<$<COMPILE_LANGUAGE:ASM>:${ASM_FLAGS}> $<$<COMPILE_LANGUAGE:ASM>:${ASM_FLAGS}>
) )
set(STRIPPED_OBSW_NAME ${OBSW_NAME}-stripped) set(STRIPPED_OBSW_NAME ${OBSW_BIN_NAME}-stripped)
add_custom_command( add_custom_command(
TARGET ${OBSW_NAME} TARGET ${OBSW_NAME}
POST_BUILD POST_BUILD
COMMAND ${CMAKE_STRIP} --strip-all ${OBSW_NAME} -o ${STRIPPED_OBSW_NAME} COMMAND ${CMAKE_STRIP} --strip-all ${OBSW_BIN_NAME} -o ${STRIPPED_OBSW_NAME}
BYPRODUCTS ${STRIPPED_OBSW_NAME} BYPRODUCTS ${STRIPPED_OBSW_NAME}
COMMENT "Generating stripped executable ${STRIPPED_OBSW_NAME}.." COMMENT "Generating stripped executable ${STRIPPED_OBSW_NAME}.."
) )