From 7aa4895fabb92f8d166bcff7a35b2c29f8d3b11b Mon Sep 17 00:00:00 2001 From: Andrew Countryman Date: Wed, 13 Mar 2024 10:13:29 -0700 Subject: [PATCH] Move CMake compile options to test builds --- CMakeLists.txt | 48 --------------------------- test/build-combination/CMakeLists.txt | 29 ++++++++++++++++ 2 files changed, 29 insertions(+), 48 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18c3ca51df..4faa639af0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -171,54 +171,6 @@ else() endif() endif() -######################################################################## -# Overall Compile Options -# Note the compile option strategy is to error on everything and then -# Per library opt-out of things that are warnings/errors. -# This ensures that no matter what strategy for compilation you take, the -# builds will still occur. -# -# Only tested with GNU and Clang. -# Other options are https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html#variable:CMAKE_%3CLANG%3E_COMPILER_ID -# Naming of compilers translation map: -# For the ?TBD? - Suggest trying GNU-based and adding the appropriate toolchain file. -# For Toolchain examples see _deps/cmake-src/toolchain/arm-none-eabil-gcc.toolchain.cmake -# -# FreeRTOS | CMake -# ------------------- -# CCS | ?TBD? -# GCC | GNU, Clang, *Clang Others? -# IAR | IAR -# Keil | ARMCC -# MSVC | MSVC # Note only for MinGW? -# Renesas | ?TBD? - -add_compile_options( - ### Gnu/Clang C Options - $<$:-fdiagnostics-color=always> - $<$:-fcolor-diagnostics> - - $<$:-Wall> - $<$:-Wextra> - $<$:-Werror> - $<$:-Wpedantic> - $<$:-Wconversion> - $<$:-Wunused-variable> - $<$:-Weverything> - - # Suppressions required to build clean with clang. - $<$:-Wno-unused-macros> - $<$:-Wno-cast-qual> - $<$:-Wno-switch-enum> - $<$:-Wno-declaration-after-statement> - $<$:-Wno-padded> - $<$:-Wno-missing-variable-declarations> - $<$:-Wno-covered-switch-default> - $<$:-Wno-extra-semi-stmt> - $<$:-Wno-missing-noreturn> - $<$:-Wno-cast-align> -) - ######################################################################## # External Dependencies # Note: For backwards compatibility - still have .gitmodules defining submodules diff --git a/test/build-combination/CMakeLists.txt b/test/build-combination/CMakeLists.txt index 45330b6bea..23505fca3a 100644 --- a/test/build-combination/CMakeLists.txt +++ b/test/build-combination/CMakeLists.txt @@ -74,6 +74,35 @@ else() add_library( freertos_config ALIAS freertos_plus_tcp_config_default) endif() +# FreeRTOS-Plus-TCP compilation options configuration +target_compile_options(freertos_plus_tcp + PRIVATE + + ### Gnu/Clang C Options + $<$:-fdiagnostics-color=always> + $<$:-fcolor-diagnostics> + + $<$:-Wall> + $<$:-Wextra> + $<$:-Werror> + $<$:-Wpedantic> + $<$:-Wconversion> + $<$:-Wunused-variable> + $<$:-Weverything> + + # Suppressions required to build clean with clang. + $<$:-Wno-unused-macros> + $<$:-Wno-cast-qual> + $<$:-Wno-switch-enum> + $<$:-Wno-declaration-after-statement> + $<$:-Wno-padded> + $<$:-Wno-missing-variable-declarations> + $<$:-Wno-covered-switch-default> + $<$:-Wno-extra-semi-stmt> + $<$:-Wno-missing-noreturn> + $<$:-Wno-cast-align> +) + # Common build combination test. add_executable(freertos_plus_tcp_build_test EXCLUDE_FROM_ALL)