Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid compilation issues in consumer projects #1139

Conversation

apcountryman
Copy link
Contributor

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 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:

  1. Added FREERTOS_PLUS_TCP_BUILD_BUILD_TEST option to control whether test/build-combination/CMakeLists.txt is processed. Updated .github/workflows/ci.yml build-checks job and test/build-combination/README.md to reflect the addition of this new option.
  2. 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.
  3. 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:

  1. Rename the FREERTOS_PLUS_TCP_BUILD_TEST option to FREERTOS_PLUS_TCP_BUILD_UNIT_TEST to better indicate what it controls.
  2. 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.
  3. 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.

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:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

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.

@apcountryman apcountryman requested a review from a team as a code owner April 25, 2024 00:09
.github/workflows/ci.yml Outdated Show resolved Hide resolved
@tony-josi-aws tony-josi-aws merged commit a4295d3 into FreeRTOS:main May 8, 2024
10 checks passed
@apcountryman apcountryman deleted the avoid_compilation_issues_in_consumer_projects branch May 8, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants