2021-06-11 12:51:20 +02:00
|
|
|
function(pre_source_hw_os_config)
|
|
|
|
|
2021-06-11 13:42:16 +02:00
|
|
|
if(${OS_FSFW} STREQUAL linux)
|
2021-06-11 12:51:20 +02:00
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
set(BSP_PATH "bsp_linux")
|
|
|
|
# Hosted
|
|
|
|
else()
|
2021-06-11 13:42:16 +02:00
|
|
|
message(FATAL_ERROR "OS_FSFW not valid, only Linux is allowed!")
|
2021-06-11 12:51:20 +02:00
|
|
|
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
|
|
|
|
"arm/stm32h743zi-nucleo" "arm/raspberrypi"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2021-06-11 13:42:16 +02:00
|
|
|
if(${TGT_BSP} MATCHES "arm/raspberrypi")
|
2021-06-11 12:51:20 +02:00
|
|
|
add_definitions(-DRASPBERRY_PI)
|
|
|
|
elseif(${TGT_BSP} MATCHES "arm/beagleboneblack")
|
|
|
|
add_definitions(-DBEAGLE_BONE_BLACK)
|
|
|
|
elseif(${TGT_BSP} MATCHES "host/none")
|
|
|
|
else()
|
|
|
|
option(ADD_LWIP_STACK "Add LwIP stack for application" OFF)
|
|
|
|
|
|
|
|
if(TGT_BSP)
|
|
|
|
message(WARNING "CMake not configured for this target!")
|
|
|
|
message(FATAL_ERROR "Target: ${TGT_BSP}!")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(BSP_PATH ${BSP_PATH} PARENT_SCOPE)
|
|
|
|
|
|
|
|
endfunction()
|