I would like to selectively compile part of an (extremely bloated and large) framework only as the elements are used.
I've had a few ideas on how I can do this, but failed to implement either properly;
Use a define macro with the same name as a class or method which toggles a variable which causes that part of the framework to be included by the preprocessor. I had an idea for an implementation of this but got stuck.
Find a way to have all my function defined as templates so that the compiler doesn't generate them until they are required. I'm unsure however how I can make this work in a multi-file project.
Is there a good way to do this without using a third-party compiler or add-on/tool?