FreeRTOS / FreeRTOS-Plus-TCP

FreeRTOS-Plus-TCP library repository. +TCP files only. Submoduled into https://github.com/FreeRTOS/FreeRTOS and various other repos.
MIT License
152 stars 163 forks source link

Move CMake compile options to test builds #1115

Closed apcountryman closed 8 months ago

apcountryman commented 8 months ago

Description

As originally discussed in the FreeRTOS Forums, FreeRTOS-Plus-TCP/CMakeLists.txt currently sets the compile options used to build FreeRTOS-Plus-TCP and its dependencies which can cause problems if the compiler used by a consumer of FreeRTOS-Plus-TCP doesn't support some of these compilation options, or these compilation options trigger compilation errors. A similar problem in FreeRTOS-Kernel was addressed by https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/872.

This PR removes the setting of compile options from FreeRTOS-Plus-TCP/CMakeLists.txt to ensure that consumers of FreeRTOS-Plus-TCP are not impacted. The compile options tested by the CI build tests are now set in FreeRTOS-Plus-TCP/test/build-combination/CMakeLists.txt. Note: the large comment block that was originally associated with the setting of compilation options in FreeRTOS-Plus-TCP/CMakeLists.txt was not moved to FreeRTOS-Plus-TCP/test/build-combination/CMakeLists.txt since it didn't seem relevant to the new approach.

Test Steps

This change was tested by executing the instructions from https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/test/build-combination/README.md#unix-linux-and-mac (reproduced below for reference) on an Ubuntu 20.04 machine.

cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL
cmake --build build --target freertos_plus_tcp_build_test
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=DISABLE_ALL
cmake --build build --target freertos_plus_tcp_build_test
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=DEFAULT_CONF
cmake --build build --target freertos_plus_tcp_build_test

The "I have tested my changes..." checklist item has not been marked since this repository's GitHub actions have not been run yet.

Checklist:

Related Issue

None.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

tony-josi-aws commented 8 months ago

@apcountryman

Thanks for taking time to contribute to the FreeRTOS+TCP