Topic : Include/exclude .c files based on selected configuration?

Forum : Ride IDE

Original Post
Post Information Post
January 30, 2012 - 8:03pm
Guest

I'd like to include or exclude specific C files in my Ride7 project, based on configuration. E.g. I would have two different configurations - let's call them A and B. For A, I'd like common.c and foo.c. For B, I'd like common.c and bar.c.

Common.c would show up in the .rapp file's ApplicationBuild section I assume.

Where would I put foo.c and bar.c? I tried adding an entry under the Config Header section for A in the .rapp file, but it didn't seem to have any effect.

Thanks for any help that can be provided!

Replies
Post Information Post
+1
0
-1
January 31, 2012 - 9:48am
Raisonance Support Team

Hi,

Indeed, you can use the Ride7 configurations. This is how the STM32 Libraries are handling support for multiple eval boards using one single project. You can refer to their examples for a full-fledged example.

All your files must be in the project (in your case, files common.c, foo.c and bar.c). Then, in a specific configuration, you should select the "Exclude from build" option on the appropriate file (bar.c is excluded from build in config A, and foo.c is excluded in config B).

Best Regards,