Author |
Topic |
|
BigHands
Senior Member
28 Posts |
Posted - Aug 27 2010 : 2:06:21 PM
|
I'm working on a platform that has two different types of CPUs (call them APU, and ZPU) - each with their own set of includes. Here is my search path as specified in Visual Studio:
c:\\foo\\APU\\include\\printf.h (contains apu_printf() ) c:\\foo\\ZPU\\include\\printf.h (contains zpu_printf() )
The Visual Studio solution contains the source files for each CPU, so the problem is, when I'm editing ZPU files and #include "printf.h", zpu_printf() doesn't have any syntax highlighting, autocomplete, or any other goodies. This is because Visual Assist thinks I'm using APU\\include\\printf.h instead of the ZPU version - obviously zpu_printf doesn't not exist in the APU version of printf.h.
Any ideas how I can vary the include search order based on the file I have open? Any other suggestions?
Thanks!
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Aug 30 2010 : 7:20:10 PM
|
So if I understand correctly, you have the include files specified under "Additional Include Directories" in your project file? You just write
#include "printf.h" and use the additional include dirs to specify the location. Am I right? How does the compiler know which file to include? (which path to use)
Which version of Visual Assist and Visual Studio are you using? |
|
|
BigHands
Senior Member
28 Posts |
Posted - Aug 30 2010 : 8:01:08 PM
|
quote: Originally posted by accord
So if I understand correctly, you have the include files specified under "Additional Include Directories" in your project file? You just write
#include "printf.h"
Correct. Of course, only the APU version of printf.h will be looked at since it's specified first in the "Additional Include Directories".
quote: Originally posted by accord How does the compiler know which file to include? (which path to use) Which version of Visual Assist and Visual Studio are you using?
In this case, Visual Studio acts only as an IDE as I use a makefile. The makefile knows which files go with either processor (APU, ZPU).
|
|
|
feline
Whole Tomato Software
United Kingdom
18951 Posts |
Posted - Aug 31 2010 : 11:56:26 AM
|
How often do you swap between code for the two processors?
You could make two dummy solutions, one for each processor. Then add all of the code to each solution, but set the project specific C++ Additional Include directories for each solution to point at this processor's API directories.
Since you are using a makefile for compiling you don't need to make the solutions compile, they are just there to help VA find the correct files. |
zen is the art of being at one with the two'ness |
|
|
BigHands
Senior Member
28 Posts |
Posted - Sep 01 2010 : 08:35:40 AM
|
quote: Originally posted by feline
How often do you swap between code for the two processors?
You could make two dummy solutions, one for each processor. Then add all of the code to each solution, but set the project specific C++ Additional Include directories for each solution to point at this processor's API directories.
I switch between the code quite often. I like where you're going with this, and I think I'll try to create two different solution configurations, each with different additional includes - that may just work!
|
|
|
feline
Whole Tomato Software
United Kingdom
18951 Posts |
Posted - Sep 01 2010 : 10:45:47 AM
|
If you only occasionally switch then changing VA's stable include directory settings might be a good solution, but it is not going to work very well if you are changing quite a lot. Two separate solutions should give you what you want quite quickly and easily. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|