# Disabling unneeded C++ modules

**URL:** <https://forums.unrealengine.com/t/disabling-unneeded-c-modules/345435>\
**Category:** Platform & Builds\
**Tags:** dependencies, modules, uht, build, unreal-engine, question\
**Created:** [January 26, 2016, 4:12pm UTC](https://forums.unrealengine.com/t/disabling-unneeded-c-modules/345435 "2016-01-26T16:12:32Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![grisevg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@grisevg](https://forums.unrealengine.com/u/grisevg)\
**Post date:** [January 26, 2016, 4:12pm UTC](https://forums.unrealengine.com/t/disabling-unneeded-c-modules/345435/1 "2016-01-26T16:12:32Z")

</div>

UE4.10.3

I found this question, but it was never answered. [https://answers.unrealengine.com/questions/222068/how-to-disable-compile-some-of-the-modules.html](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.

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [February 8, 2016, 4:28pm UTC](https://forums.unrealengine.com/t/disabling-unneeded-c-modules/345435/2 "2016-02-08T16:28:14Z")

</div>

Hello,

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?

---

<div class="post-metadata">

**Author:** ![grisevg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@grisevg](https://forums.unrealengine.com/u/grisevg)\
**Post date:** [February 8, 2016, 4:43pm UTC](https://forums.unrealengine.com/t/disabling-unneeded-c-modules/345435/3 "2016-02-08T16:43:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [February 8, 2016, 4:47pm UTC](https://forums.unrealengine.com/t/disabling-unneeded-c-modules/345435/4 "2016-02-08T16:47:17Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![grisevg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@grisevg](https://forums.unrealengine.com/u/grisevg)\
**Post date:** [February 8, 2016, 4:57pm UTC](https://forums.unrealengine.com/t/disabling-unneeded-c-modules/345435/5 "2016-02-08T16:57:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [February 10, 2016, 1:48pm UTC](https://forums.unrealengine.com/t/disabling-unneeded-c-modules/345435/6 "2016-02-10T13:48:52Z")

</div>

Hello,

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

---

<div class="post-metadata">

**Author:** ![grisevg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@grisevg](https://forums.unrealengine.com/u/grisevg)\
**Post date:** [February 10, 2016, 1:52pm UTC](https://forums.unrealengine.com/t/disabling-unneeded-c-modules/345435/7 "2016-02-10T13:52:10Z")

</div>

Thanks for clarification

---

<div class="post-metadata">

**Author:** ![rlabrecque](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rlabrecque](https://forums.unrealengine.com/u/rlabrecque)\
**Post date:** [October 1, 2017, 9:45pm UTC](https://forums.unrealengine.com/t/disabling-unneeded-c-modules/345435/8 "2017-10-01T21:45:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [October 6, 2017, 11:56am UTC](https://forums.unrealengine.com/t/disabling-unneeded-c-modules/345435/9 "2017-10-06T11:56:01Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![rlabrecque](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rlabrecque](https://forums.unrealengine.com/u/rlabrecque)\
**Post date:** [October 10, 2017, 3:40pm UTC](https://forums.unrealengine.com/t/disabling-unneeded-c-modules/345435/10 "2017-10-10T15:40:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rlabrecque](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rlabrecque](https://forums.unrealengine.com/u/rlabrecque)\
**Post date:** [March 1, 2018, 10:46pm UTC](https://forums.unrealengine.com/t/disabling-unneeded-c-modules/345435/11 "2018-03-01T22:46:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_61ce53b7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_61ce53b7](https://forums.unrealengine.com/u/anonymous_user_61ce53b7)\
**Post date:** [October 25, 2018, 5:58am UTC](https://forums.unrealengine.com/t/disabling-unneeded-c-modules/345435/12 "2018-10-25T05:58:21Z")

</div>

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
