I am working in a very large code base that has conditional compile flags to build code for several different embedded hardware platforms. There is a large part of the code that is common and there is a hardware adaptation layer that is supposed to be h/w independent but also has a lot of common code with function calls to specific hardware functions that are wrapped in #ifdef #else for conditional compilation. This is unfortunately the paradigm imposed on us for how we work across several teams so I need to work with it ie- no option to move to really hardware independent files. I develop and debug for all 3 (so far) of these platforms and keep having to add/delete the compiler flags from my Symbols and re-build my CDT index each time I need to context switch from developing/debugging an issue with one platform to another. Rebuilding the index can take a long time (up to an hour) , even with aggressive resource filtering.
We work with Perforce as our CVS and I want to work within a single Perforce workspace so I don't get out of sync with which files are checked out. I tried to create separate Eclipse projects for each of these types of platforms but I get an error message that the resource (the Perforce workspace code) is already in use by another project.
Does anyone have any suggestions?
I am using Eclipse Luna with CDT.
Thanks
For the part where you mentioned the need to delete and add Symbols and change build options in the Project Properties, this is what Configurations are for. Assuming the settings are pretty static for a given configuration (specific hardware platform), define a list of configurations, one per platform, and set the options according to the platform in question. This way, just changing configs will change the set of build options.
This is also true for file-specific settings, like "exclude from build". You can have varying set of files to build for each platform.
I don't know if Eclipse will re-index every time you switch configurations.