Our code base conditionally compiles code based on compile-time configs. CDT plugin in Eclipse currently does not index compiled-out code, so I can’t jump to a function definition if it’s within #ifdef. How could I enable indexing to work?
Our code base conditionally compiles code based on compile-time configs. CDT plugin in Eclipse
Share
You can’t assume that code would compile if the conditionals are ignored. In this light this feature cannot work (in the general case).
I suggest using a build configuration that defines all the required symbols to compile all the blocks. Of course that means that instead of having
you’ll have to use the more cumbersome
So you can let the indexer work with
-DFEATURE_X -DFEATURE_Y. However, you can’t debug in such configuration, because both blocks would get executed as well