From 503d5923c4f5431aa05154e04355aef34f0d48d2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 30 Jul 2021 16:40:24 +0200 Subject: [PATCH] making some stuff optional --- CMakeLists.txt | 3 ++- cmake/Q7SCrossCompileConfig.cmake | 32 ++++++++++++++++--------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f56a4fc..9afa81ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,8 @@ if(TGT_BSP MATCHES "arm/q7s") endif() option(ADD_ETL_LIB "Add ETL library" ON) -option(ADD_JSON_LIB "Add JSON librara" ON) +option(ADD_JSON_LIB "Add JSON library" ON) +option(EIVE_SYSROOT_MAGIC "Perform sysroot magic which might not be necessary" OFF) if(NOT FSFW_OSAL) set(FSFW_OSAL host CACHE STRING "OS for the FSFW.") diff --git a/cmake/Q7SCrossCompileConfig.cmake b/cmake/Q7SCrossCompileConfig.cmake index 746df453..006b2c96 100644 --- a/cmake/Q7SCrossCompileConfig.cmake +++ b/cmake/Q7SCrossCompileConfig.cmake @@ -54,21 +54,23 @@ set(CMAKE_SYSTEM_PROCESSOR "armv7") set(CMAKE_C_COMPILER ${CROSS_COMPILE_CC}) set(CMAKE_CXX_COMPILER ${CROSS_COMPILE_CXX}) -# List of library dirs where LD has to look. Pass them directly through gcc. -set(LIB_DIRS - "${SYSROOT_PATH}/usr/include" - "${SYSROOT_PATH}/usr/include/linux" - "${SYSROOT_PATH}/usr/lib" - "${SYSROOT_PATH}/lib" - "${SYSROOT_PATH}" - "${SYSROOT_PATH}/usr/lib/arm-xiphos-linux-gnueabi" -) -# You can additionally check the linker paths if you add the -# flags ' -Xlinker --verbose' -set(COMMON_FLAGS "-I${SYSROOT_PATH}/usr/lib") -foreach(LIB ${LIB_DIRS}) - set(COMMON_FLAGS "${COMMON_FLAGS} -L${LIB} -Wl,-rpath-link,${LIB}") -endforeach() +if(EIVE_SYSROOT_MAGIC) + # List of library dirs where LD has to look. Pass them directly through gcc. + set(LIB_DIRS + "${SYSROOT_PATH}/usr/include" + "${SYSROOT_PATH}/usr/include/linux" + "${SYSROOT_PATH}/usr/lib" + "${SYSROOT_PATH}/lib" + "${SYSROOT_PATH}" + "${SYSROOT_PATH}/usr/lib/arm-xiphos-linux-gnueabi" + ) + # You can additionally check the linker paths if you add the + # flags ' -Xlinker --verbose' + set(COMMON_FLAGS "-I${SYSROOT_PATH}/usr/lib") + foreach(LIB ${LIB_DIRS}) + set(COMMON_FLAGS "${COMMON_FLAGS} -L${LIB} -Wl,-rpath-link,${LIB}") + endforeach() +endif() set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH}"