I made a MyProjEditorExtensionModule
, I’d like it to be compiled only in Development Editor+Win64
configuration, but not in Shipping+Win64
. I mean, I only want it to produce UE4Editor-MyProjEditorExtension.dll
but not UE4-MyProjEditorExtension.dll
(not sure if this is the right file name, anyway this is the result dll file of the Shipping configuration).
Why I want this is because this module is for the editor only, the game does not need it. I believe the Editor modules made by Epic (of the path Engine/Source/Editor) won’t be compiled when I do a Shipping+Win64 build for my game, right? If so I’d like the same thing.
So is this possible? Or did I misunderstand the mechanism? Thanks.
Hi Marson,
Modules get compiled when they are referenced by other modules or the target being built. If you want to omit your module from specific builds you will want to modify the build.cs file to conditionally reference your module.
For example in the build.cs file you could do something such as this
if(UEBuildConfiguration.bBuildEditor == true)
{
//reference the module "MyModule"
PrivateDependencyModuleNames.Add("MyModule");
}
Cheers,
Jonathan
1 Like
Hi Jonathan:
The solution should be fine, but some other questions came to my mind, I hope you can help me again:
- Just want to make sure these codes are to be added in
MyProj.Build.cs
, right?
- If I add these codes, then
MyModule
would be compiled if I’m building the editor version of MyProj
, but I can’t specify which editor version. Is there any method to make MyModule
only compiles for certain build configuration, I mean the configuration like Development Editor+Win64
. Maybe I only want to build MyModule
for Debug build or maybe some custom added configuration?
- I’m adding codes like
OutExtraModuleNames.Add("MyModule")
in the MyProjEditor.Target.cs
right now, is this the same thing?
- Is there any documentation explaining how things like
PrivateDependencyModuleNames
work? There are so many of them and the only documentation is the comment of these variables, it would be great if any more detailed explanation (maybe with example use) exist.
Thanks.
Marson