Module Properties

An overview of Unreal Build Tool Modules, including property descriptions.

Modules are the building blocks of Unreal Engine (UE). The engine is implemented as a large collection of modules, and games supply their own modules to augment them. Each module encapsulates a set of functionality, and can provide a public interface and compile environment (with macros, include paths, and so on) for use by other modules.

Modules are declared through C# source files with a .build.cs extension, and are stored under your project's Source directory. The C++ source code belonging to a module is stored next to to the .build.cs file, or in subdirectories of it. Each .build.cs file declares a class deriving from the ModuleRules base class, and sets properties controlling how it should be built from its constructor. These .build.cs files are compiled by Unreal Build Tool (UBT) and constructed to determine the overall compile environment.

The typical structure for a .build.cs file is as follows.

using UnrealBuildTool;
using System.Collections.Generic;
public class MyModule : ModuleRules
{
    public MyModule(ReadOnlyTargetRules Target) : base(Target)
    {
        // Properties and settings go here
    }
}

Read-Only Properties

IsPlugin (Boolean)

Returns true if a Plugin contains this module.

HasPackageOverride (Boolean)

Returns true if there has been an override type specified on this module.

AutoSdkDirectory (String)

The AutoSDK directory for the active host platform.

EngineDirectory (String)

The current engine directory.

PluginDirectory (String)

Property for the directory containing this plugin. Useful for adding paths to third party dependencies.

ModuleDirectory (String)

Property for the directory containing this module. Useful for adding paths to third party dependencies.

TestsDirectory (String)

Returns module's low level tests directory Tests.

BuildOrderSettings (SourceFilesBuildOrderSettings)

Optional compilation order override rules for module's source files.

IsVcPackageSupported (Boolean)

Returns if VcPkg is supported for the build configuration.

Read/Write Properties

Type (ModuleType)

Type of module.

BinariesSubFolder (String)

Subfolder of Binaries/PLATFORM folder to put this module in when building Dynamic-Link Libraries (DLLs). This should only be used by modules that are found via searching like the TargetPlatform or ShaderFormat modules. If FindModule is not used to track them down, the modules will not be found.

PrivatePCHHeaderFile (String)

Explicit private Precompiled Header (PCH) for this module. Implies that this module will not use a shared PCH.

SharedPCHHeaderFile (String)

Header file name for a shared PCH provided by this module. Must be a valid relative path to a public C++ header file. This should only be set for header files that are included by a significant number of other C++ modules.

ShortName (String)

Specifies an alternate name for intermediate directories and files for intermediates of this module. Useful when hitting path length limitations.

bTreatAsEngineModule (Boolean)

Whether this module should be treated as an engine module (for example, using engine definitions, PCHs, compiled with optimizations enabled in DebugGame configurations). Initialized to a default based on the rules assembly it was created from.

bDeterministic (Boolean)

Set flags for deterministic compiles (experimental, may not be fully supported). Deterministic linking is controlled via TargetRules.

bUseRTTI (Boolean)

Use run time type information.

bUseAVX (Boolean)

Direct the compiler to generate AVX instructions wherever SSE or AVX intrinsics are used, on the platforms that support it. Note that by enabling this you are changing the minspec for the PC platform, and the resultant executable will crash on machines without AVX support.

bEnableBufferSecurityChecks (Boolean)

Enable buffer security checks. This should usually be enabled as it prevents severe security risks.

bEnableExceptions (Boolean)

Enable exception handling.

bEnableObjCExceptions (Boolean)

Enable Objective-C exception handling.

bEnableUndefinedIdentifierWarnings (Boolean)

Enable warnings for using undefined identifiers in #if expressions.

StaticAnalyzerCheckers (HashSet<String>)

The static analyzer checkers that should be enabled rather than the defaults. This is only supported for Clang. For a full list, see Clang Checkers in the Clang documentation. You can also run clang -Xclang -analyzer-checker-help, or clang -Xclang -analyzer-checker-help-alpha for the list of experimental checkers.

StaticAnalyzerDisabledCheckers (HashSet<String>)

The static analyzer default checkers that should be disabled. Unused if StaticAnalyzerCheckers is populated. This is only supported for Clang. This overrides the default disabled checkers, which are deadcode.DeadStores and security.FloatLoopCounter. For a full list, see Clang Checkers in the Clang documentation. You can also run clang -Xclang -analyzer-checker-help, or clang -Xclang -analyzer-checker-help-alpha for the list of experimental checkers.

StaticAnalyzerAdditionalCheckers (HashSet<String>)

The static analyzer non-default checkers that should be enabled. Unused if StaticAnalyzerCheckers is populated. This is only supported for Clang. For a full list, see Clang Checkers in the Clang documentation. You can also run clang -Xclang -analyzer-checker-help, or clang -Xclang -analyzer-checker-help-alpha for the list of experimental checkers.

bMergeUnityFiles (Boolean)

Whether to merge the module and generated unity files for faster compilation.

MinSourceFilesForUnityBuildOverride (Int32)

The number of source files in this module before unity build will be activated for that module. If set to anything besides -1, will override the default setting which is controlled by MinGameModuleSourceFilesForUnityBuild.

MinFilesUsingPrecompiledHeaderOverride (Int32)

Overrides BuildConfiguration.MinFilesUsingPrecompiledHeader if non-zero.

bBuildLocallyWithSNDBS (Boolean)

Module uses a #import so must be built locally when compiling with SN-DBS.

IsRedistributableOverride (Nullable<Boolean>)

Redistribution override flag for this module.

bLegalToDistributeObjectCode (Boolean)

Whether the output from this module can be publicly distributed, even if it has code/dependencies on modules that are not (for example, CarefullyRedist, NotForLicensees, NoRedist). This should be used when you plan to release binaries but not source.

AllowedRestrictedFolders (List<String>)

List of folders which are allowed to be referenced when compiling this binary, without propagating restricted folder names.

AliasRestrictedFolders (Dictionary<String, String>)

Set of aliased restricted folder references.

bEnforceIWYU (Boolean)

Enforce "Include What You Use" (IWYU) rules when PCHUsage is set to ExplicitOrSharedPCH; warns when monolithic headers (for example, Engine.h, UnrealEd.h, and so on) are used, and checks that source files include their matching header first.

bAddDefaultIncludePaths (Boolean)

Whether to add all the default include paths to the module (for example, the Source/Classes folder, subfolders under Source/Public).

bIgnoreUnresolvedSymbols (Boolean)

Whether to ignore dangling (for example, unresolved external) symbols in modules.

bPrecompile (Boolean)

Whether this module should be precompiled. Defaults to the bPrecompile flag from the target. Clear this flag to prevent a module being precompiled.

bUsePrecompiled (Boolean)

Whether this module should use precompiled data. Always true for modules created from installed assemblies.

bAllowConfidentialPlatformDefines (Boolean)

Whether this module can use PLATFORM_XXXX style defines, where XXXX is a confidential platform name. This is used to ensure engine or other shared code does not reveal confidential information inside an #if PLATFORM_XXXX block. However, Licensee game code may want to allow for them.

PublicIncludePathModuleNames (List<String>)

List of modules names (no path needed) with header files that our module's public headers needs access to, but we don't need to "import" or link against.

PublicDependencyModuleNames (List<String>)

List of public dependency module names (no path needed) (automatically does the private/public include). These are modules that are required by our public source files.

PrivateIncludePathModuleNames (List<String>)

List of modules name (no path needed) with header files that our module's private code files needs access to, but we don't need to "import" or link against.

PrivateDependencyModuleNames (List<String>)

List of private dependency module names. These are modules that our private code depends on but nothing in our public include files depend on.

CircularlyReferencedDependentModules (List<String>)

Only for legacy reasons, should not be used in new code. List of module dependencies that should be treated as circular references. These modules must have already been added to either the public or private dependent module list.

PublicSystemIncludePaths (List<String>)

List of system/library include paths - typically used for External (third party) modules. These are public stable header file directories that are not checked when resolving header dependencies.

PublicIncludePaths (List<String>)

List of all paths to include files that are exposed to other modules. (This setting is currently not needed as we discover all files from the Public folder).

InternalncludePaths (List<String>)

List of all paths to include files that are exposed to other internal modules. (This setting is currently not needed as we discover all files from the Internal folder).

PrivateIncludePaths (List<String>)

List of all paths to this module's internal include files, not exposed to other modules (at least one include to the Private path, more if we want to avoid relative paths).

PublicSystemLibraryPaths (List<String>)

List of system library paths (directory of .lib files) - for External (third party) modules please use the PublicAdditionalLibaries instead.

PrivateRuntimeLibraryPaths (List<String>)

List of search paths for libraries at runtime (for example, .so files).

PublicRuntimeLibraryPaths (List<String>)

List of search paths for libraries at runtime (for example, .so files).

PublicAdditionalLibraries (List<String>)

List of additional libraries (names of the .lib files including extension) - typically used for External (third party) modules.

PublicPreBuildLibraries (List<String>)

List of additional pre-build libraries (names of the .lib files including extension) - typically used for additional targets which are still built, but using either TargetRules.PreBuildSteps or TargetRules.PreBuildTargets.

PublicSystemLibraries (List<String>)

List of system libraries to use - these are typically referenced via name and then found via the system paths. If you need to reference a .lib file use the PublicAdditionalLibraries instead.

PublicFrameworks (List<String>)

List of XCode frameworks (iOS and MacOS).

PublicWeakFrameworks (List<String>)

List of weak frameworks (for OS version transitions).

PublicAdditionalFrameworks (List<Framework>)

List of additional frameworks - typically used for External (third party) modules on Mac and iOS.

AdditionalBundleResources (List<BundleResource>)

List of additional resources that should be copied to the app bundle for Mac or iOS.

TypeLibraries (List<TypeLibrary>)

List of type libraries that we need to generate headers for (Windows only).

PublicDelayLoadDLLs (List<String>)

List of delay load DLLs - typically used for External (third party) modules.

PrivateDefinitions (List<String>)

Private compiler definitions for this module.

PublicDefinitions (List<String>)

Public compiler definitions for this module.

DynamicallyLoadedModuleNames (List<String>)

Additional modules this module may require at run-time.

RuntimeDependencies (RuntimeDependencyList)

List of files which this module depends on at runtime. These files will be staged along with the target.

AdditionalPropertiesForReceipt (ReceiptPropertyList)

List of additional properties to be added to the build receipt.

PrecompileForTargets (PrecompileTargetsType)

Which targets this module should be precompiled for.

ExternalDependencies (List<String>)

External files which invalidate the makefile if modified. Relative paths are resolved relative to the .Build.cs file.

SubclassRules (List<String>)

Subclass rules files which invalidate the makefile if modified.

bRequiresImplementModule (Nullable<Boolean>)

Whether this module requires the IMPLEMENT_MODULE macro to be implemented. Most UE modules require this, since we use the IMPLEMENT_MODULE macro to do other global overloads (for example, operator new/delete forwarding to GMalloc).

bValidateCircularDependencies (Boolean)

Whether circular dependencies will be validated against the allow list circular module dependencies result in slower builds. Disabling this option is strongly discouraged. This option is ignored for Engine modules which will always be validated against the allow list.

CppStandard (CppStandardVersion)

Which standard to use for compiling this module.

CStandard (CStandardVersion)

Which standard to use for compiling this module.

ModuleSymbolVisibility (SymbolVisibility)

Control visibility of symbols.

Name (String)

Name of this module.

OverridePackageType (PackageOverrideType)

Overridden type of module that will set different package flags. Cannot be used for modules that are a part of a plugin because that is set in the .uplugin file already.

OptimizeCode (CodeOptimization)

When this module's code should be optimized.

PCHUsage (PCHUsageMode)

Precompiled header usage for this module.

DefaultBuildSettings (BuildSettingsVersion)

Which engine version's build settings to use by default.

IncludeOrderVersion (EngineIncludeOrderVersion)

What version of include order to use when compiling this module. Can be overridden via -ForceIncludeOrder on the command line or in a module's rules.

ShadowVariableWarningLevel (WarningLevel)

How to treat shadow variable warnings.

UnsafeTypeCastWarningLevel (WarningLevel)

How to treat unsafe implicit type cast warnings (for example, double->float or int64->int32).

bUseUnity (Boolean)

If unity builds are enabled this can be used to override if this specific module will be built using Unity. This is set using the per module configurations in BuildConfiguration.cs.

bLegacyPublicIncludePaths (Boolean)

Whether this module qualifies included headers from other modules relative to the root of their Public folder. This reduces the number of search paths that have to be passed to the compiler, improving performance and reducing the length of the compiler command line.