We have a C++ plugin that should be migrated to Unreal 4.15 but so far we have not managed to find out how to do it in backwards compatible manner.
The main problem however is that we want to use one codebase and migrate to UE 4.15 and still be backwards compatible with older versions (UE version <= 4.14). The new rule that all cpp files should start with their own header and not with the precompiled one directly contradicts the pre 4.15 rule of one precompiled header at the beginning of every cpp.
Reading in the forum I have found this question Precompiled header includes break in 4.15 and as suggested inside I’ve tried this option inside Build.cs file:
PCHUsage = PCHUsageMode.NoSharedPCHs;
but as far as I can see this is not making the plugin build like the old system, not to mention that there are compilation errors. I have tried another thing - setting the precompiled header that we should use with
PCHHeaderField = “Private/MyPluginPrivatePCH.h”;
and this seems to work as advertised - Unreal includes that precompiled header and things are fine as long as every cpp still starts with it’s corresponding header.
Unfortunately this is not backwards compatible because of the contradicting build header rules… unless we include some pre-build step that comments/uncomments the precompiled header in every cpp but this is extra work that we prefer not doing, not to mention that I see no way of doing this in platform agnostic way.
Any suggestions on how to update our code and retain backwards compatibility?