toolchain magic optional now

This commit is contained in:
Robin Müller 2021-08-02 16:21:40 +02:00
parent e56b4dcd56
commit 46a5765593
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
4 changed files with 44 additions and 32 deletions

View File

@ -20,10 +20,18 @@ endif()
if(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack") if(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack")
option(LINUX_CROSS_COMPILE "Cross compile for a Linux board" ON) option(LINUX_CROSS_COMPILE "Cross compile for a Linux board" ON)
set(FSFW_HAL_ADD_LINUX "Add the FSFW HAL for Linux systems" ON) set(FSFW_HAL_ADD_LINUX "Add the FSFW HAL for Linux systems" ON)
option(FSFW_BBB_TOOLCHAIN_FILE_MAGIC
"Perform library magic in toolchain file. Might be removed soon"
OFF
)
endif() endif()
if(TGT_BSP MATCHES "arm/raspberrypi") if(TGT_BSP MATCHES "arm/raspberrypi")
set(FSFW_HAL_ADD_RASPBERRY_PI "Add Raspberry Pi specific HAL files" ON) set(FSFW_HAL_ADD_RASPBERRY_PI "Add Raspberry Pi specific HAL files" ON)
option(FSFW_RPI_TOOLCHAIN_FILE_MAGIC
"Perform library magic in toolchain file. Might be removed soon"
OFF
)
endif() endif()
# Perform steps like loading toolchain files where applicable. # Perform steps like loading toolchain files where applicable.

View File

@ -68,20 +68,22 @@ set(CMAKE_SYSROOT "${SYSROOT_PATH}")
set(CMAKE_SYSTEM_NAME "Linux") set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "arm") set(CMAKE_SYSTEM_PROCESSOR "arm")
# List of library dirs where LD has to look. Pass them directly through gcc. if(FSFW_BBB_TOOLCHAIN_FILE_MAGIC)
# LD_LIBRARY_PATH is not evaluated by arm-*-ld # List of library dirs where LD has to look. Pass them directly through gcc.
set(LIB_DIRS # LD_LIBRARY_PATH is not evaluated by arm-*-ld
set(LIB_DIRS
"${SYSROOT_PATH}/lib/${MUTLIARCH_FOLDER_NAME}" "${SYSROOT_PATH}/lib/${MUTLIARCH_FOLDER_NAME}"
"${SYSROOT_PATH}/usr/local/lib" "${SYSROOT_PATH}/usr/local/lib"
"${SYSROOT_PATH}/usr/lib/${MUTLIARCH_FOLDER_NAME}" "${SYSROOT_PATH}/usr/lib/${MUTLIARCH_FOLDER_NAME}"
"${SYSROOT_PATH}/usr/lib" "${SYSROOT_PATH}/usr/lib"
) )
# You can additionally check the linker paths if you add the # You can additionally check the linker paths if you add the
# flags ' -Xlinker --verbose' # flags ' -Xlinker --verbose'
set(COMMON_FLAGS "-I${SYSROOT_PATH}/usr/include") set(COMMON_FLAGS "-I${SYSROOT_PATH}/usr/include")
foreach(LIB ${LIB_DIRS}) foreach(LIB ${LIB_DIRS})
set(COMMON_FLAGS "${COMMON_FLAGS} -L${LIB} -Wl,-rpath-link,${LIB}") set(COMMON_FLAGS "${COMMON_FLAGS} -L${LIB} -Wl,-rpath-link,${LIB}")
endforeach() endforeach()
endif()
set(CMAKE_C_FLAGS set(CMAKE_C_FLAGS
"-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard ${COMMON_FLAGS}" "-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard ${COMMON_FLAGS}"

View File

@ -83,9 +83,10 @@ else()
set(CMAKE_SYSTEM_PROCESSOR "arm") set(CMAKE_SYSTEM_PROCESSOR "arm")
endif() endif()
# List of library dirs where LD has to look. Pass them directly through gcc. if(FSFW_RPI_TOOLCHAIN_FILE_MAGIC)
# LD_LIBRARY_PATH is not evaluated by arm-*-ld # List of library dirs where LD has to look. Pass them directly through gcc.
set(LIB_DIRS # LD_LIBRARY_PATH is not evaluated by arm-*-ld
set(LIB_DIRS
"${SYSROOT_PATH}/opt/vc/lib" "${SYSROOT_PATH}/opt/vc/lib"
"${SYSROOT_PATH}/lib/${MULTIARCH_FOLDER_NAME}" "${SYSROOT_PATH}/lib/${MULTIARCH_FOLDER_NAME}"
"${SYSROOT_PATH}/usr/local/lib" "${SYSROOT_PATH}/usr/local/lib"
@ -93,13 +94,14 @@ set(LIB_DIRS
"${SYSROOT_PATH}/usr/lib" "${SYSROOT_PATH}/usr/lib"
"${SYSROOT_PATH}/usr/lib/${MULTIARCH_FOLDER_NAME}/blas" "${SYSROOT_PATH}/usr/lib/${MULTIARCH_FOLDER_NAME}/blas"
"${SYSROOT_PATH}/usr/lib/${MULTIARCH_FOLDER_NAME}/lapack" "${SYSROOT_PATH}/usr/lib/${MULTIARCH_FOLDER_NAME}/lapack"
) )
# You can additionally check the linker paths if you add the # You can additionally check the linker paths if you add the
# flags ' -Xlinker --verbose' # flags ' -Xlinker --verbose'
set(COMMON_FLAGS "-I${SYSROOT_PATH}/usr/include") set(COMMON_FLAGS "-I${SYSROOT_PATH}/usr/include")
foreach(LIB ${LIB_DIRS}) foreach(LIB ${LIB_DIRS})
set(COMMON_FLAGS "${COMMON_FLAGS} -L${LIB} -Wl,-rpath-link,${LIB}") set(COMMON_FLAGS "${COMMON_FLAGS} -L${LIB} -Wl,-rpath-link,${LIB}")
endforeach() endforeach()
endif()
if(RASPBERRY_VERSION VERSION_GREATER 3) if(RASPBERRY_VERSION VERSION_GREATER 3)
set(CMAKE_C_FLAGS set(CMAKE_C_FLAGS

2
fsfw

@ -1 +1 @@
Subproject commit dee063e25928f8b24cbd3fc49130d453feb01dd4 Subproject commit 0e5cfcf28f0183d7286d1160a40dcff2017f7795