Skip to content

Commit 8d95eaf

Browse files
Move CMake compile options to test builds (#1115)
Co-authored-by: Tony Josi <[email protected]>
1 parent a6653e4 commit 8d95eaf

File tree

2 files changed

+29
-48
lines changed

2 files changed

+29
-48
lines changed

CMakeLists.txt

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -176,54 +176,6 @@ else()
176176
endif()
177177
endif()
178178

179-
########################################################################
180-
# Overall Compile Options
181-
# Note the compile option strategy is to error on everything and then
182-
# Per library opt-out of things that are warnings/errors.
183-
# This ensures that no matter what strategy for compilation you take, the
184-
# builds will still occur.
185-
#
186-
# Only tested with GNU and Clang.
187-
# Other options are https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html#variable:CMAKE_%3CLANG%3E_COMPILER_ID
188-
# Naming of compilers translation map:
189-
# For the ?TBD? - Suggest trying GNU-based and adding the appropriate toolchain file.
190-
# For Toolchain examples see _deps/cmake-src/toolchain/arm-none-eabil-gcc.toolchain.cmake
191-
#
192-
# FreeRTOS | CMake
193-
# -------------------
194-
# CCS | ?TBD?
195-
# GCC | GNU, Clang, *Clang Others?
196-
# IAR | IAR
197-
# Keil | ARMCC
198-
# MSVC | MSVC # Note only for MinGW?
199-
# Renesas | ?TBD?
200-
201-
add_compile_options(
202-
### Gnu/Clang C Options
203-
$<$<COMPILE_LANG_AND_ID:C,GNU>:-fdiagnostics-color=always>
204-
$<$<COMPILE_LANG_AND_ID:C,Clang>:-fcolor-diagnostics>
205-
206-
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wall>
207-
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wextra>
208-
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Werror>
209-
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wpedantic>
210-
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wconversion>
211-
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wunused-variable>
212-
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Weverything>
213-
214-
# Suppressions required to build clean with clang.
215-
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-unused-macros>
216-
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-cast-qual>
217-
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-switch-enum>
218-
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-declaration-after-statement>
219-
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-padded>
220-
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-missing-variable-declarations>
221-
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-covered-switch-default>
222-
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-extra-semi-stmt>
223-
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-missing-noreturn>
224-
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-cast-align>
225-
)
226-
227179
########################################################################
228180
# External Dependencies
229181
# Note: For backwards compatibility - still have .gitmodules defining submodules

test/build-combination/CMakeLists.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,35 @@ else()
7474
add_library( freertos_config ALIAS freertos_plus_tcp_config_default)
7575
endif()
7676

77+
# FreeRTOS-Plus-TCP compilation options configuration
78+
target_compile_options(freertos_plus_tcp
79+
PRIVATE
80+
81+
### Gnu/Clang C Options
82+
$<$<COMPILE_LANG_AND_ID:C,GNU>:-fdiagnostics-color=always>
83+
$<$<COMPILE_LANG_AND_ID:C,Clang>:-fcolor-diagnostics>
84+
85+
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wall>
86+
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wextra>
87+
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Werror>
88+
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wpedantic>
89+
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wconversion>
90+
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wunused-variable>
91+
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Weverything>
92+
93+
# Suppressions required to build clean with clang.
94+
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-unused-macros>
95+
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-cast-qual>
96+
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-switch-enum>
97+
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-declaration-after-statement>
98+
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-padded>
99+
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-missing-variable-declarations>
100+
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-covered-switch-default>
101+
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-extra-semi-stmt>
102+
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-missing-noreturn>
103+
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-cast-align>
104+
)
105+
77106
# Common build combination test.
78107
add_executable(freertos_plus_tcp_build_test EXCLUDE_FROM_ALL)
79108

0 commit comments

Comments
 (0)