Well, to my surprise it seems @Zeblote is right. I’m not sure what changed in the recent versions but I did this in my . Target.cs files and it worked perfectly fine:
public MyProjectTarget(TargetInfo Target) : base(Target)
{
this.Type = TargetType.Game;
this.ExtraModuleNames.AddRange(
new string] {
"MyProject"
});
this.bEnforceIWYU = true;
this.bCompileLeanAndMeanUE = true;
this.bForceEnableRTTI = true;
this.bForceEnableExceptions = true;
}
And
public MyProjectEditorTarget(TargetInfo Target) : base(Target)
{
this.Type = TargetType.Editor;
this.ExtraModuleNames.AddRange(
new string] {
"MyProject",
"MyProjectEditor"
});
this.bEnforceIWYU = true;
this.bCompileLeanAndMeanUE = true;
this.bForceEnableRTTI = true;
}
Adding editor module to the game module’s ExtraModuleNames is not necessary anymore. Thus, no check if we are building an editor build.
Now my editor module works inside the editor and it won’t get build for non-editor builds.