UBT recompiles all my files very often, even when I change only one file. Why?
Notes:
it only recompiles my own files, not UE4 files,
I am working on an editor plugin (with a custom FEdModule) so hot-reload is not accessible (except with "Window > Dev tool > Module > Find the module name in the loooong list > Recompile takes a long time ; but this does not always work, for example when I change anything related to Slate ).
I don’t know how to fill MyPluginPrivatePCH.h, I just have one line for now:
Long build times usually means too many dependencies. For example, the slate code is probably getting rebuilt everytime you build your module, because now it is a dependency. Hence moving slate headers to the MyPluginPrivatePCH.h would be a good way of reducing this build time. PCH is basically pre-compiled headers. In your case, it will just link your module to all the libraries you are using in PCH and wouldn’t need to do that again. Unless, you modify your PCH, your build times should be local to whatever is being built within the module.
I don’t think so, whatever UBT it is usally needed, maybe moving some header files to PCH might help too as kishoreven said, what i’m saying it’s from my own observation. Deviding your plugin in to more modules will help you, you need to divide it to runtime and editor module anyway if you plan to make any editor code that affects the packaged game.
Sorry for the late reply. 's answer is about right. I think it has to do greatly with come up with an architecture for your plugin and sort of iterating over the plan to divide them into modules. Also you don’t have to add the header files from your module into the pch.