WIN32-MingW Demo cannot be built on Eclipse

I found WIN32-MingW Demo makes compiler error on build process on Eclipse.
It is seen on the latest version of main branch on Github and NOT seen on FreeRTOS 202212.01 package.

The reason of error is some mismatches between Eclipse project file(.cproject) and actual source file structures.
I confirmed .cprojct file has not been changed since 202212.01 release.
So, maybe some source file structures have been changed and it makes those mismatches.

Those compile errors can be solved by modifying .cprojct file.
The following 4 modifications are needed to build demo.
Could anyone give me opinions for the following modifications idea?

  1. Exclude the following source directory from build.
    FreeRTOS/Source/example/cmake_example
    This directory contains main.c file. It makes compile error because of the conflict of multiple main() functions.
    The original main.c file exists in the root directory of demo project.
    This extra main.c file seems to have been added by this change on the last year.

  2. Exclude the following extra source directories in Trace recorder from build.
    FreeRTOS+Trace Recorder/extras
    FreeRTOS+Trace Recorder/kernelports/BareMetal
    FreeRTOS+Trace Recorder/kernelports/ESP-IDF_FreeRTOS
    FreeRTOS+Trace Recorder/kernelports/ThreadX
    FreeRTOS+Trace Recorder/kernelports/Zephyr
    Those directories cause compiler error. Those directories are not needed to build demo.

  3. New include path should be added.
    FreeRTOS+Trace Recorder/kernelports/FreeRTOS/include

  4. Include path should be modified.
    Before:FreeRTOS+Trace Recorder/Include
    After : FreeRTOS+Trace Recorder/include
    (I is modified to i)
    3 and 4 are needed to solve compiler error(“no such file or directory” for #include directive)

If those modifications are acceptable, I can send PR to repository.

By the way, I was wondering why CI system on Github Actions builds MingW-Demo successfully.
Now, I understand CI system does not use Eclipse. CI system uses make command directly.
It means there is another option for solving this issue.
It is modifying Eclipse setting file(.cproject) to use this Makefile file like CI system.
But I don’t think it is good idea because Eclipse users expect the project setting can be customized on Eclipse GUI.

I think you can exclude the example directory. I assume you are going to use resource filter for this, right?

Yes, please raise a PR.

I agree - lets update the .cproject as you mentioned before.

@aggarg

Thank you for a quick response!

I assume you are going to use resource filter for this, right?

No, I’m using “Exclude from build” now.
I think “Resource filter” and “Exclude from build” seem to be almost same.
Difference of them are discussed here for example.

For this time, I think “Exclude from build” is better than “Resource filter”. The reason is that some directories are already registered as “Exclude from build” but “Resource filter” is empty now. I think we should follow previous way to avoid additional complexity.

I agree - lets update the .cproject as you mentioned before.

Thank you for your agreement.
I will send PR after tests.

The benefit of using Resource Filter is that it removes the unrelated files from GUI altogether, thereby reducing cognitive load for the user.

@aggarg

Thank you for explanation. I didn’t know about those differences.
I found Resource Filter is also already used in some directories in current MinGW demo.

I am trying to use Resource Filter instead of Exclude from Build.
In the most of cases, it works expectedly.
But some cases, Exclude from Build is still needed because some directories are used only on Debug configuration and not used on Debug_CodeCoverage configuration.
Exclude from Build can be specified to each configurations separately but Resource Filter cannot. If Resource Filter is used there, unused directories are included in Debug_CodeCoverage configuration and average code coverage will be decreased by this change. It is not what we want.

I try to use Resource Filter mainly but Exclude from Build will be still used.
If you have any opinion, please let me know.
Thank you for your advice!

Yes, you need to use “Exclude from Build” for resources which need to be used in some configurations.

Sounds perfect!