As originally discussed in the FreeRTOS Forums, projects that consume FreeRTOS-Plus-TCP are forced to use the compilation options configured by test/build-combination/CMakeLists.txt when compiling freertos_plus_tcp which can cause compilation issues. This PR avoids compilation issues in consumer projects by making processing of test/build-combination/CMakeLists.txt optional:
Added FREERTOS_PLUS_TCP_BUILD_BUILD_TEST option to control whether test/build-combination/CMakeLists.txt is processed. Updated .github/workflows/ci.ymlbuild-checks job and test/build-combination/README.md to reflect the addition of this new option.
Moved FREERTOS_PLUS_TCP_TEST_CONFIGURATION cache variable configuration/validation to test/build-combination/CMakeLists.txt since it is now only needed if FREERTOS_PLUS_TCP_BUILD_BUILD_TEST is ON. Updated comments to reflect changes.
Moved configuration of the C standard used to compile freertos_plus_tcp to test/build-combination/CMakeLists.txt so that projects that consume FreeRTOS-Plus-TCP can control the C standard they use when compiling freertos_plus_tcp.
The following changes were considered but are not currently implemented in this PR:
Rename the FREERTOS_PLUS_TCP_BUILD_TEST option to FREERTOS_PLUS_TCP_BUILD_UNIT_TEST to better indicate what it controls.
Rename the test/build-combination/ directory to test/build-test/ to better reflect what its contents are for and mirror the test/unit-test/ directory's naming.
Rename the FREERTOS_PLUS_TCP_TEST_CONFIGURATION cache variable to FREERTOS_PLUS_TCP_BUILD_TEST_CONFIGURATION to reflect its association with the new FREERTOS_PLUS_TCP_BUILD_BUILD_TEST option.
Description
As originally discussed in the FreeRTOS Forums, projects that consume FreeRTOS-Plus-TCP are forced to use the compilation options configured by
test/build-combination/CMakeLists.txt
when compilingfreertos_plus_tcp
which can cause compilation issues. This PR avoids compilation issues in consumer projects by making processing oftest/build-combination/CMakeLists.txt
optional:FREERTOS_PLUS_TCP_BUILD_BUILD_TEST
option to control whethertest/build-combination/CMakeLists.txt
is processed. Updated.github/workflows/ci.yml
build-checks
job andtest/build-combination/README.md
to reflect the addition of this new option.FREERTOS_PLUS_TCP_TEST_CONFIGURATION
cache variable configuration/validation totest/build-combination/CMakeLists.txt
since it is now only needed ifFREERTOS_PLUS_TCP_BUILD_BUILD_TEST
isON
. Updated comments to reflect changes.freertos_plus_tcp
totest/build-combination/CMakeLists.txt
so that projects that consume FreeRTOS-Plus-TCP can control the C standard they use when compilingfreertos_plus_tcp
.The following changes were considered but are not currently implemented in this PR:
FREERTOS_PLUS_TCP_BUILD_TEST
option toFREERTOS_PLUS_TCP_BUILD_UNIT_TEST
to better indicate what it controls.test/build-combination/
directory totest/build-test/
to better reflect what its contents are for and mirror thetest/unit-test/
directory's naming.FREERTOS_PLUS_TCP_TEST_CONFIGURATION
cache variable toFREERTOS_PLUS_TCP_BUILD_TEST_CONFIGURATION
to reflect its association with the newFREERTOS_PLUS_TCP_BUILD_BUILD_TEST
option.Test Steps
Compilation issues were encountered in a private project (see https://forums.freertos.org/t/freertos-plus-tcp-compilation-issues/19825/4) that is built using arm-none-eabi-gcc (9.2.1) for an Arm Cortex-M4F processor. The changes made in this PR have resolved the compilation issues that were encountered in that private project. These changes have also been tested using the instructions in https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/86b16eb1f514574df19a31c78c8937600ba5a81a/test/build-combination/README.md#unix-linux-and-mac and https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/86b16eb1f514574df19a31c78c8937600ba5a81a/test/unit-test/README.md#to-run-the-unit-tests.
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.