How to connect an Editor module to Release?

Simplest case:

I add #include “UnrealEdMessages.h” to the precompiled header. Compile editor - everything is perfect, fancy dandy. I switch the build to game - it fails to build because it does not know what UnrealEdMessages.h is. Fine, good. I go to ProjectName.Build.cs, and add the “UnrealEdMessages” module t the PublicDependencyModuleNames.
Now, when I compile in game, I fail on a .generated include inside of the cpp (so the module is recognized okay, but the UnrealEdMessages.generated.h inside of the .cpp is not found)

I have been dancing with this problem for quite a while, and I don’t know how to resolve this. Please help!!