(0000770)
|
andras
|
2012-09-27 10:30
|
|
Background: We use the C++ index for dependency generation in the Makefile. Makefiles are refreshed before each build, and thus dependencies in them are also updated if needed. Originally (in 4.0), we used some simple code to basically just grep all #include lines from the source files, and turn that into dependencies. Then, when we introduced Project Features, lots of #includes in INET/INETMANET became conditional (inside #if/#ifdef), and we had switch to a more sophisticated solution that only takes the actually active #include lines as dependencies (and ignores those in disabled code blocks). The idea was to use the index, because CDT's parser follows the #ifs/#ifdefs correctly and knows which #includes are active and which are not. The consequence was that we had to ensure that the index is up to date before each build, otherwise dependencies in the generated Makefiles would be based on obsolete info, which could result in non-obvious build errors.
Updating the index is usually incremental (=fast). However, when defined symbols change (as e.g. in the case of turning project features on or off), CDT cannot update the index incrementally, but instead we have to trigger a full reindexing which takes a long time. Other changes in the C/C++ configuration of the project may also trigger full reindexing. After just source code changes, however, CDT can incrementally update the index, so it shouldn't take long. |
|