Hello,
I currently have a project that pulls from other projects depending on the build configuration. I thought that I had it working, but it seems to "remember" files and randomly pull from the projects.
Example:
I have my primary project that is specific to a design and will eventually have a custom board. In a second project, I have stripped out everything except the pin_mux files so I can work with the dev board until the custom board is delivered. Additionally, I have a common project that contains more generalized files and I'm treating it as a library. In the primary project, I have added/renamed the build configurations such that I have a DevBoard_Debug, a ProjectSpecific_Debug, and Release. For now, I'm simply trying to use the DevBoard_Debug to point to the secondary project "board" folder to pull the pin_mux files; I removed the reference to the primary "board" folder from the include folder. However, as I walk through the code, I see files from the primary project "board" folder, the secondary project "board" folder, and the library "board" folder.
Questions:
Solved! Go to Solution.
Hello,
After studying the above links and some experimentation, I came across a possible solution that seems to work well in my situation; I added controlled filters to the source location. The filters appear to be specific to my build configurations and this works really well with a sample size of 1. Not sure if this is useful to other people, but thought I'd at least share.
1. I think the question is about #includes: here the rule is that include folders are processed in the order which is given by the -I option. You need to be a bit careful with using header files having the same name (which is not recommended) or if you are using recursive include folder structures.
2. You always could do 'link to files or folders' in your project (https://mcuoneclipse.com/2014/08/15/link-to-files-and-folders-in-eclipse/ ). I'm heavily doing this for 'common' parts similar to your project (I think). I'm think all the names and folder names for the config tools are fixed, and I don't remember a way to change this.
3. You might have a look at the structure I have used with https://github.com/ErichStyger/MetaClockClock . They do share 98% of the code and several boards/configurations have been implemented. But the config tools are still dedicated for each project.
I hope this helps,
Erich
Hello ErichS,
Thank you for the prompt reply. I am in the process of looking at your answers for #2 and #3, but I think the include folders are correct and I have the . Do you see anything that I missed?
Try adding the -H option to the compiler which will print each include file used. You can then use the output to debug what you are doing wrong.
Hello,
After studying the above links and some experimentation, I came across a possible solution that seems to work well in my situation; I added controlled filters to the source location. The filters appear to be specific to my build configurations and this works really well with a sample size of 1. Not sure if this is useful to other people, but thought I'd at least share.
Could you provide a reference to "Controlled Filters" in Eclipse? I couldn't find anything when I did a search.
I'm in a similar situation and I would like to understand how this can be automated.
Thanx!
Hi Myke,
The filters I'm using are part of the Source Location tab.
For me, it was enough to filter out the pin_mux files so the compiler didn't see them and it looked in the other folder. In the ProjectSpecific and Release build configurations, I didn't add the secondary project to the include list and I didn't need to add the filter.