From 23ba1a997d78e182f5828221e76dae7c4a91cd68 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 20 Feb 2022 10:34:41 +0100 Subject: [PATCH 1/2] create unique bin name again --- CMakeLists.txt | 16 ++++++++++++---- cmake/HardwareOsPostConfig.cmake | 4 ++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a3dd1d7c..6af72d48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,8 +22,13 @@ if(NOT FSFW_OSAL) set(FSFW_OSAL linux CACHE STRING "OS for the FSFW.") endif() -if(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack") - option(LINUX_CROSS_COMPILE ON) +if(TGT_BSP) + 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() # Perform steps like loading toolchain files where applicable. @@ -160,7 +165,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") "-Wno-unused-parameter" "-Wno-psabi" ) - message(STATUS "goes here") + # Remove unused sections. add_compile_options( "-ffunction-sections" @@ -182,6 +187,8 @@ add_library(${LIB_EIVE_MISSION}) # Add executable add_executable(${OBSW_NAME}) +set(OBSW_BIN_NAME ${CMAKE_PROJECT_NAME}-$ENV{USERNAME}) +set_target_properties(${OBSW_NAME} PROPERTIES OUTPUT_NAME ${OBSW_BIN_NAME}) #watchdog add_executable(${WATCHDOG_NAME} EXCLUDE_FROM_ALL) @@ -336,9 +343,10 @@ string(CONCAT POST_BUILD_COMMENT add_custom_command( TARGET ${OBSW_NAME} POST_BUILD - COMMAND ${CMAKE_SIZE} ${OBSW_NAME}${FILE_SUFFIX} + COMMAND ${CMAKE_SIZE} ${OBSW_BIN_NAME}${FILE_SUFFIX} COMMENT ${POST_BUILD_COMMENT} ) + include (${CMAKE_SCRIPT_PATH}/BuildType.cmake) set_build_type() diff --git a/cmake/HardwareOsPostConfig.cmake b/cmake/HardwareOsPostConfig.cmake index 3000366b..e7fb257a 100644 --- a/cmake/HardwareOsPostConfig.cmake +++ b/cmake/HardwareOsPostConfig.cmake @@ -41,12 +41,12 @@ add_compile_options( $<$:${ASM_FLAGS}> ) -set(STRIPPED_OBSW_NAME ${OBSW_NAME}-stripped) +set(STRIPPED_OBSW_NAME ${OBSW_BIN_NAME}-stripped) add_custom_command( TARGET ${OBSW_NAME} 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} COMMENT "Generating stripped executable ${STRIPPED_OBSW_NAME}.." ) -- 2.43.0 From 9c7a203930a61cf9cc2aafc6b486aee7cb6a76c3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 21 Feb 2022 10:41:22 +0100 Subject: [PATCH 2/2] make unique name optional --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6af72d48..4f906903 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ option(EIVE_BUILD_UNITTESTS "Build Catch2 unittests" OFF) option(EIVE_ADD_ETL_LIB "Add ETL 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_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" ON) if(NOT FSFW_OSAL) set(FSFW_OSAL linux CACHE STRING "OS for the FSFW.") @@ -187,7 +188,11 @@ add_library(${LIB_EIVE_MISSION}) # Add executable add_executable(${OBSW_NAME}) -set(OBSW_BIN_NAME ${CMAKE_PROJECT_NAME}-$ENV{USERNAME}) +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 -- 2.43.0