From c4220b37e59ce38ecb2a73beeae5ec928b0c3be8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 20 Apr 2022 00:57:37 +0200 Subject: [PATCH] add option for external toolchain file --- CMakeLists.txt | 7 +++++-- cmake/PreProjectConfig.cmake | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ef85e12..79813efd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,10 @@ set(CMAKE_SCRIPT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") option(EIVE_ADD_ETL_LIB "Add ETL library" ON) option(EIVE_ADD_JSON_LIB "Add JSON library" ON) - +option(EIVE_HARDCODED_TOOLCHAIN_FILE "\ +For Linux Board Target BSPs, a default toolchain file will be set. Should be set to OFF \ +if a different toolchain file is set externally" ON +) option(EIVE_SYSROOT_MAGIC "Perform sysroot magic which might not be necessary" OFF) option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" ON) @@ -41,7 +44,7 @@ include(${CMAKE_SCRIPT_PATH}/PreProjectConfig.cmake) pre_project_config() # Check whether the user has already installed Catch2 first. This has to come before -# the project call. We could also exlcude doing this when the Q7S primary OBSW is built.. +# the project call. We could also exclude doing this when the Q7S primary OBSW is built.. find_package(Catch2 3 CONFIG QUIET) # Project Name diff --git a/cmake/PreProjectConfig.cmake b/cmake/PreProjectConfig.cmake index 41dd7de4..e032965a 100644 --- a/cmake/PreProjectConfig.cmake +++ b/cmake/PreProjectConfig.cmake @@ -11,7 +11,7 @@ endif() # Disable compiler checks for cross-compiling. -if(FSFW_OSAL MATCHES linux AND TGT_BSP) +if(FSFW_OSAL MATCHES linux AND TGT_BSP AND NOT EIVE_HARDCODED_TOOLCHAIN_FILE) if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/te0720-1cfa") set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SCRIPT_PATH}/Zynq7020CrossCompileConfig.cmake"