We have a large C++ project and would like to ship only the code that a customer asks for, thus removing all code that is not needed. I.e. if we have some metaprograms like:
/** File: calc.c */
#ifdef ENABLE_SOME_ADVANCED_FEATURE
/** Advanced calculations */
void AdvancedCalc(int a, int b) {
// ...
}
#else
/** Basic calculations */
void BasicCalc(int a, int b) {
// ...
}
#endif
I would like some script that does preprocessing of C++ metaprograms, thus if I only wanted the basic calculations after running the script the file would look like this:
/** File: calc.min.c */
/** Basic calculations */
void BasicCalc(int a, int b) {
// ...
}
Thus, all the code we did not want to ship has been stripped away.
I'm sure there must be something like this out there.
Update:
I think How to get rid of ifdef's in a large c project has the solution I was looking for.