Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds an option to use clang PCH to build a pch and then use it.
On my computer this makes clean build times go from 92 seconds without PCH to 11 seconds with PCH.
For me PCH isn't even really about clean build time though that is what Unity Builds are for. This also makes incremental builds in user code considerably faster as you can pre compile all the expensive bloated headers from godot-cpp and from your own code. I measured this by just changing a number in example.cpp, without PCH this takes about 10 seconds to recompile. With PCH that same change only takes 3 seconds.
The way this is implemented is definitely wrong though and i'll need some help/tips on how to get it to fit more idiomatically in with the godot-cpp build. I ripped this straight out of how I currently do it in my engine module build system. I'm not really sure what the best way to adapt it to fit properly into godot-cpp's build system is since PCH is very complicated but it probably has to be it's own Builder which I don't' really know how to do.
It's also very compiler specific, this only works for clang. I've tested GCC's PCH and it pretty much doesn't work at all in my experience. I guess msvc also has solid PCH that scons has a built in Builder for but I've never used it.
There are also some minor problems with my current implementation because I can't figure out a way to get godot-cpp to generate all the bindings files without actually doing a full compilation. There doesn't seem to be any option to do that and the binding gen is so tightly coupled with the build system it's hard to figure it out.