From b23309a5f4f1b73f86ee5d560f830e551e4b1e5e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 19 Jan 2021 16:30:17 +0100 Subject: [PATCH] improved options --- CMakeLists.txt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d6911f61..9dbd24cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,10 @@ cmake_minimum_required(VERSION 3.13) +option(FSFW_WARNING_SHADOW_LOCAL_GCC "Enable -Wshadow=local warning in GCC" ON) +# Options to exclude parts of the FSFW from compilation. +option(FSFW_USE_RMAP "Compile with RMAP" ON) +option(FSFW_USE_DATALINKLAYER "Compile with Data Link Layer" ON) + set(LIB_FSFW_NAME fsfw) add_library(${LIB_FSFW_NAME}) @@ -40,9 +45,7 @@ endif() message(STATUS "Compiling FSFW for the ${OS_FSFW_NAME} operating system.") -# Options to exclude parts of the FSFW from compilation. -option(FSFW_USE_RMAP "Compile with RMAP" ON) -option(FSFW_USE_DATALINKLAYER "Compile with Data Link Layer" ON) + add_subdirectory(action) add_subdirectory(container) @@ -116,12 +119,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") -Wno-unused-parameter -Wno-psabi ) - - if(NOT DEFINED WARNING_SHADOW_LOCAL) - option(WARNING_SHADOW_LOCAL "Show shadows declarations warning." ON) - endif() - if(WARNING_SHADOW_LOCAL) + if(FSFW_WARNING_SHADOW_LOCAL_GCC) list(APPEND WARNING_FLAGS "-Wshadow=local") endif()