using options now

This commit is contained in:
Robin Müller 2021-03-23 16:13:09 +01:00
parent 45eb9cbe2b
commit 547c788c81
2 changed files with 8 additions and 3 deletions

View File

@ -1,5 +1,10 @@
cmake_minimum_required(VERSION 3.13)
option(FSFW_HAL_ADD_LINUX "Add the Linux HAL to the sources. Required gpiod library" OFF)
option(FSFW_HAL_ADD_RASPBERRY_PI "Add Raspberry Pi specific code to the sources" OFF)
option(FSFW_HAL_ADD_STM32H7 "Add the STM32H7 HAL to the sources" OFF)
set(LIB_FSFW_HAL_NAME fsfw_hal)
set(LINUX_HAL_PATH_NAME linux)
set(STM32H7_PATH_NAME stm32h7)
@ -19,11 +24,11 @@ target_sources(${LIB_FSFW_HAL_NAME} PRIVATE
Dummy.cpp
)
if(TGT_BSP MATCHES "arm/raspberrypi")
if(FSFW_HAL_ADD_LINUX)
add_subdirectory(${LINUX_HAL_PATH_NAME})
endif()
if(TGT_BSP MATCHES "arm/stm32h743zi-nucleo")
if(FSFW_HAL_ADD_STM32H7)
add_subdirectory(${STM32H7_PATH_NAME})
endif()

View File

@ -1,4 +1,4 @@
if(TGT_BSP MATCHES "arm/raspberrypi")
if(FSFW_HAL_ADD_RASPBERRY_PI)
add_subdirectory(rpi)
endif()