reworked cmake, unfortunately a big one due to interdependence
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

- /mission is a library now, in preparation of unittests (which bring their own main)
- eive-simple is now only available in bsp=arm/q7s (but is still not compiling)
- watchdog and simple are their own executables, not configurations any more
- moved some q7s specific code into /bsp-q7s to flatten if-hierarchy in main CMakeLists.txt
- compiler and linker options are not globally applied to all targets
- linux is the default fsfw osal now, as current code does not compile on hosted
This commit is contained in:
2022-02-09 21:38:56 +01:00
parent e56c538518
commit 4d154b7cee
36 changed files with 200 additions and 171 deletions

View File

@ -3,7 +3,7 @@ function(post_source_hw_os_config)
if(LINK_LWIP)
message(STATUS "Linking against ${LIB_LWIP_NAME} lwIP library")
if(LIB_LWIP_NAME)
target_link_libraries(${TARGET_NAME} PUBLIC
target_link_libraries(${OBSW_NAME} PUBLIC
${LIB_LWIP_NAME}
)
else()
@ -12,7 +12,7 @@ if(LINK_LWIP)
endif()
if(LINKER_SCRIPT)
target_link_options(${TARGET_NAME} PRIVATE
add_link_options(
-T${LINKER_SCRIPT}
)
endif()
@ -35,20 +35,20 @@ if(CMAKE_VERBOSE)
endif()
# Generator expression. Can be used to set different C, CXX and ASM flags.
target_compile_options(${TARGET_NAME} PRIVATE
add_compile_options(
$<$<COMPILE_LANGUAGE:C>:${C_DEFS} ${C_FLAGS}>
$<$<COMPILE_LANGUAGE:CXX>:${CXX_DEFS} ${CXX_FLAGS}>
$<$<COMPILE_LANGUAGE:ASM>:${ASM_FLAGS}>
)
set(STRIPPED_TARGET_NAME ${TARGET_NAME}-stripped)
set(STRIPPED_OBSW_NAME ${OBSW_NAME}-stripped)
add_custom_command(
TARGET ${TARGET_NAME}
TARGET ${OBSW_NAME}
POST_BUILD
COMMAND ${CMAKE_STRIP} --strip-all ${TARGET_NAME} -o ${STRIPPED_TARGET_NAME}
BYPRODUCTS ${STRIPPED_TARGET_NAME}
COMMENT "Generating stripped executable ${STRIPPED_TARGET_NAME}.."
COMMAND ${CMAKE_STRIP} --strip-all ${OBSW_NAME} -o ${STRIPPED_OBSW_NAME}
BYPRODUCTS ${STRIPPED_OBSW_NAME}
COMMENT "Generating stripped executable ${STRIPPED_OBSW_NAME}.."
)
endfunction()