Avoid compilation issues in consumer projects #1139
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.