Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Disabling unneeded C++ modules.


I found this question, but it was never answered. https://answers.unrealengine.com/questions/222068/how-to-disable-compile-some-of-the-modules.html

When I build from the source version of the engine, it builds lots of modules that I don't need.

What's the proper way to disable modules that I know I definitely don't need (I have Paper 2D game so I definitely don't need Landscape and Foliage, etc).

In my Build.cs file I only have PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "Paper2D" }); but I still see lots of unneeded modules being compiled.

Product Version: UE 4.10
more ▼

asked Jan 26 '16 at 04:12 PM in Packaging & Deployment

avatar image

141 8 15 20

avatar image Sean L ♦♦ STAFF Feb 08 '16 at 04:28 PM


I'd like to clarify something. Are you asking if you can exclude modules from a source build when building it through Visual Studio, or are you asking if you can exclude them from a packaged version of your game?

avatar image grisevg Feb 08 '16 at 04:43 PM

I want to exclude them from the packaged versions to make IPA and APK smaller.

avatar image Sean L ♦♦ STAFF Feb 08 '16 at 04:47 PM

Thank you for the clarification. Only the modules that you include in the Build.cs file should be included in the package.

What are you seeing when you package your game with those files excluded?

avatar image grisevg Feb 08 '16 at 04:57 PM

I see modules like Foliage, Landscape, MoviePlayer, etc. My game doesn't use those and they aren't in Build.cs, so it would be great to omit them from binary to cut down its size.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first


I have received more information on this topic. Removing C++ modules is not something that we support currently. While you are welcome to experiment with it, there is no guarantee that your game would function properly with some modules removed.

Also, keep in mind that removing some modules may not make much of a different in terms of file size, and the amount of effort required to do so may not be worth the decrease in size.

Have a great day

more ▼

answered Feb 10 '16 at 01:48 PM

avatar image

Sean L ♦♦ STAFF
43.5k 485 152 443

avatar image grisevg Feb 10 '16 at 01:52 PM

Thanks for clarification

avatar image rlabrecque Oct 01 '17 at 09:45 PM

Hey Sean, do you know if this is something that is planned at all by now? I'm sick of recompiling/linking things like OnlineSubSystemOculus (and like 100 more...) when compiling Development Editor.

avatar image Sean L ♦♦ STAFF Oct 06 '17 at 11:56 AM

Hi DaFox,

I spoke with one of our developers to double-check on the progress of this, and the long term plan is to move things into plugins where we can, but it's going to happen slowly over time.

The example that you are giving, OnlineSubsystemOculus, is already a plugin, so you should be able to just disable it in your project through Edit->Plugins.

Also, a note: if you are building the UE4Editor target rather than your game project's editor, it is meant to build all plugins since it is usable by any content-only project.

Hope that helps!

avatar image rlabrecque Oct 10 '17 at 03:40 PM

Thanks a lot Sean!

I think that actually cleared up some confusion I had about the build targets. (I think build targets in general could use a more straight forward documentation pass. Currently there's just a like a really short basic "when you first start do this", and then an overly complex "here's how it works internally" section.

I'm really looking forward to things like build time and general workflow improvements. That's my biggest issue coming from Unity.

avatar image rlabrecque Mar 01 '18 at 10:46 PM

Hey again Sean, I just wanted to provide an update; that note about the UE4 target was huge!

When I do a clean build with that target I build about 2100 items. When I build the target for our game we get down to 1400. I expect this could end up under 1000, but we still see things like OnlineSubsystemOculus and RHI's that we don't use get built, so there's still some progress that could be made. Hopefully the engine continues to get modularized because not everyone has the computation power and money to to throw at build times. When our non-editor targets get built we're down to ~400 build items.

avatar image Chang Xiaoqi Oct 25 '18 at 05:58 AM

Hi Sean , I`d like to give plugin-developers a engine with no .cpp. for example,first I build a engine and delete all the .cpp files in private folder,then i give these files and dlls to plugin-developers. they use this engine version to create their plugin ,build and test. My idea is to skip build all the modules which have no .cpp,I am not sure if it is possible.Could you give me some advice

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question