2020-12-29 01:09:59 +01:00
|
|
|
function(pre_source_hw_os_config)
|
|
|
|
|
|
|
|
# FreeRTOS
|
2021-07-15 01:25:32 +02:00
|
|
|
if(FSFW_OSAL MATCHES freertos)
|
2020-12-29 01:09:59 +01:00
|
|
|
message(FATAL_ERROR "No FreeRTOS support implemented yet.")
|
|
|
|
# RTEMS
|
2021-07-15 01:25:32 +02:00
|
|
|
elseif(FSFW_OSAL STREQUAL rtems)
|
2020-12-29 01:09:59 +01:00
|
|
|
add_definitions(-DRTEMS)
|
|
|
|
message(FATAL_ERROR "No RTEMS support implemented yet.")
|
2021-07-15 01:25:32 +02:00
|
|
|
elseif(FSFW_OSAL STREQUAL linux)
|
2020-12-29 01:09:59 +01:00
|
|
|
add_definitions(-DUNIX -DLINUX)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
# Hosted
|
|
|
|
else()
|
|
|
|
set(BSP_PATH "bsp_hosted")
|
|
|
|
if(WIN32)
|
|
|
|
add_definitions(-DWIN32)
|
|
|
|
elseif(UNIX)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
add_definitions(-DUNIX -DLINUX)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Cross-compile information
|
|
|
|
if(CMAKE_CROSSCOMPILING)
|
|
|
|
# set(CMAKE_VERBOSE TRUE)
|
|
|
|
|
|
|
|
message(STATUS "Cross-compiling for ${TGT_BSP} target")
|
|
|
|
message(STATUS "Cross-compile gcc: ${CMAKE_C_COMPILER}")
|
|
|
|
message(STATUS "Cross-compile g++: ${CMAKE_CXX_COMPILER}")
|
|
|
|
|
|
|
|
if(CMAKE_VERBOSE)
|
|
|
|
message(STATUS "Cross-compile linker: ${CMAKE_LINKER}")
|
|
|
|
message(STATUS "Cross-compile size utility: ${CMAKE_SIZE}")
|
|
|
|
message(STATUS "Cross-compile objcopy utility: ${CMAKE_OBJCOPY}")
|
|
|
|
message(STATUS "Cross-compile ranlib utility: ${CMAKE_RANLIB}")
|
|
|
|
message(STATUS "Cross-compile ar utility: ${CMAKE_AR}")
|
|
|
|
message(STATUS "Cross-compile nm utility: ${CMAKE_NM}")
|
|
|
|
message(STATUS "Cross-compile strip utility: ${CMAKE_STRIP}")
|
|
|
|
message(STATUS
|
|
|
|
"Cross-compile assembler: ${CMAKE_ASM_COMPILER} "
|
|
|
|
"-x assembler-with-cpp"
|
|
|
|
)
|
|
|
|
message(STATUS "ABI flags: ${ABI_FLAGS}")
|
|
|
|
message(STATUS "Custom linker script: ${LINKER_SCRIPT}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set_property(CACHE TGT_BSP
|
|
|
|
PROPERTY STRINGS
|
2020-12-29 01:40:47 +01:00
|
|
|
"arm/q7s" "arm/raspberrypi"
|
2020-12-29 01:09:59 +01:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2020-12-29 12:22:35 +01:00
|
|
|
if(TGT_BSP)
|
2021-08-23 20:38:18 +02:00
|
|
|
if (TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack")
|
2021-05-05 20:25:52 +02:00
|
|
|
set(BSP_PATH "bsp_linux_board")
|
2021-08-23 20:38:18 +02:00
|
|
|
elseif(TGT_BSP MATCHES "arm/q7s")
|
2020-12-29 13:59:31 +01:00
|
|
|
set(BSP_PATH "bsp_q7s")
|
2020-12-29 12:22:35 +01:00
|
|
|
else()
|
2020-12-29 01:09:59 +01:00
|
|
|
message(WARNING "CMake not configured for this target!")
|
|
|
|
message(FATAL_ERROR "Target: ${TGT_BSP}!")
|
|
|
|
endif()
|
2020-12-29 14:53:34 +01:00
|
|
|
else()
|
|
|
|
set(BSP_PATH "bsp_hosted")
|
2020-12-29 01:09:59 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(BSP_PATH ${BSP_PATH} PARENT_SCOPE)
|
|
|
|
|
|
|
|
endfunction()
|