keywords: UE4, Building, UnrealBuildTool, ModuleRules, UEBuildTarget

ModuleRules APIs In Common

Path:

\Engine\Source\Programs\UnrealBuildTool\Configuration\ModuleRules.cs

API in Common:

/// <summary>
/// Use run time type information
/// </summary>
public bool bUseRTTI = false;

/// <summary>
/// Use AVX instructions
/// </summary>
public bool bUseAVX = false;

/// <summary>
/// Enable buffer security checks.  This should usually be enabled as it prevents severe security risks.
/// </summary>
public bool bEnableBufferSecurityChecks = true;

/// <summary>
/// Enable exception handling
/// </summary>
public bool bEnableExceptions = false;

/// <summary>
/// Enable objective C exception handling
/// </summary>
public bool bEnableObjCExceptions = false;

/// <summary>
/// Enable warnings for shadowed variables
/// </summary>
public bool bEnableShadowVariableWarnings = true;

/// <summary>
/// Enable warnings for using undefined identifiers in #if expressions
/// </summary>
public bool bEnableUndefinedIdentifierWarnings = true;

/// <summary>
/// Enforce "include what you use" rules when PCHUsage is set to ExplicitOrSharedPCH; warns when monolithic headers (Engine.h, UnrealEd.h, etc...) 
/// are used, and checks that source files include their matching header first.
/// </summary>
public bool bEnforceIWYU = true;

/// <summary>
/// Whether to add all the default include paths to the module (eg. the Source/Classes folder, subfolders under Source/Public).
/// </summary>
public bool bAddDefaultIncludePaths = true;

/// <summary>
/// Whether this module should be precompiled. Defaults to the bPrecompile flag from the target. Clear this flag to prevent a module being precompiled.
/// </summary>
public bool bPrecompile;

/// <summary>
/// Whether this module should use precompiled data. Always true for modules created from installed assemblies.
/// </summary>
public bool bUsePrecompiled;

/// <summary>
/// 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.
/// </summary>
public List<string> PublicSystemIncludePaths = new List<string>();

/// <summary>
/// (This setting is currently not need as we discover all files from the 'Public' folder) List of all paths to include files that are exposed to other modules
/// </summary>
public List<string> PublicIncludePaths = new List<string>();

/// <summary>
/// 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)
/// </summary>
public List<string> PrivateIncludePaths = new List<string>();

/// <summary>
/// List of system/library paths (directory of .lib files) - typically used for External (third party) modules
/// </summary>
public List<string> PublicLibraryPaths = new List<string>();

/// <summary>
/// List of search paths for libraries at runtime (eg. .so files)
/// </summary>
public List<string> PrivateRuntimeLibraryPaths = new List<string>();

/// <summary>
/// List of search paths for libraries at runtime (eg. .so files)
/// </summary>
public List<string> PublicRuntimeLibraryPaths = new List<string>();

/// <summary>
/// List of additional libraries (names of the .lib files including extension) - typically used for External (third party) modules
/// </summary>
public List<string> PublicAdditionalLibraries = new List<string>();

/// <summary>
/// List of delay load DLLs - typically used for External (third party) modules
/// </summary>
public List<string> PublicDelayLoadDLLs = new List<string>();

/// <summary>
/// Private compiler definitions for this module
/// </summary>
public List<string> PrivateDefinitions = new List<string>();

/// <summary>
/// Public compiler definitions for this module
/// </summary>
public List<string> PublicDefinitions = new List<string>();

/// <summary>
/// Which stanard to use for compiling this module
/// </summary>
public CppStandardVersion CppStandard = CppStandardVersion.Default;

UEBuildTarget.cs

UnrealTargetPlatform

Define:

public enum UnrealTargetPlatform
{
    /// <summary>
    /// Unknown target platform
    /// </summary>
    Unknown,

    /// <summary>
    /// 32-bit Windows
    /// </summary>
    Win32,

    /// <summary>
    /// 64-bit Windows
    /// </summary>
    Win64,

    /// <summary>
    /// Mac
    /// </summary>
    Mac,

    /// <summary>
    /// XboxOne
    /// </summary>
    XboxOne,

    /// <summary>
    /// Playstation 4
    /// </summary>
    PS4,

    /// <summary>
    /// iOS
    /// </summary>
    IOS,

    /// <summary>
    /// Android
    /// </summary>
    Android,

    /// <summary>
    /// HTML5
    /// </summary>
    HTML5,

    /// <summary>
    /// Linux
    /// </summary>
    Linux,

    /// <summary>
    /// All desktop platforms
    /// </summary>
    AllDesktop,

    /// <summary>
    /// TVOS
    /// </summary>
    TVOS,

    /// <summary>
    /// Nintendo Switch
    /// </summary>
    Switch,

    /// <summary>
    /// NDA'd platform Quail
    /// </summary>
    Quail,

    /// <summary>
    /// Confidential platform
    /// </summary>
    Lumin,
}
UnrealPlatformGroup

Define:

public enum UnrealPlatformGroup
{
    /// <summary>
    /// this group is just to lump Win32 and Win64 into Windows directories, removing the special Windows logic in MakeListOfUnsupportedPlatforms
    /// </summary>
    Windows,

    /// <summary>
    /// Microsoft platforms
    /// </summary>
    Microsoft,

    /// <summary>
    /// Apple platforms
    /// </summary>
    Apple,

    /// <summary>
    /// making IOS a group allows TVOS to compile IOS code
    /// </summary>
    IOS,

    /// <summary>
    /// Unix platforms
    /// </summary>
    Unix,

    /// <summary>
    /// Android platforms
    /// </summary>
    Android,

    /// <summary>
    /// Sony platforms
    /// </summary>
    Sony,

    /// <summary>
    /// Target all desktop platforms (Win64, Mac, Linux) simultaneously
    /// </summary>
    AllDesktop,
}
UnrealPlatformClass

Defined:

public enum UnrealPlatformClass
{
    /// <summary>
    /// All platforms
    /// </summary>
    All,

    /// <summary>
    /// All desktop platforms (Win32, Win64, Mac, Linux)
    /// </summary>
    Desktop,

    /// <summary>
    /// All platforms which support the editor (Win64, Mac, Linux)
    /// </summary>
    Editor,

    /// <summary>
    /// Platforms which support running servers (Win32, Win64, Mac, Linux)
    /// </summary>
    Server,
}
UnrealTargetConfiguration
public enum UnrealTargetConfiguration
{
    /// <summary>
    /// Unknown
    /// </summary>
    Unknown,

    /// <summary>
    /// Debug configuration
    /// </summary>
    Debug,

    /// <summary>
    /// DebugGame configuration; equivalent to development, but with optimization disabled for game modules
    /// </summary>
    DebugGame,

    /// <summary>
    /// Development configuration
    /// </summary>
    Development,

    /// <summary>
    /// Shipping configuration
    /// </summary>
    Shipping,

    /// <summary>
    /// Test configuration
    /// </summary>
    Test,
}

ReadOnlyTargetRules APIs in common

Path:

Engine\Source\Programs\UnrealBuildTool\Configuration\TargetRules.cs

Properties:

public UnrealTargetPlatform Platform
{
    get { return Inner.Platform; }
}

public UnrealTargetConfiguration Configuration
{
    get { return Inner.Configuration; }
}

public string Architecture
{
    get { return Inner.Architecture; }
}

Reference

[UE4]Build.cs Notes
https://dawnarc.com/2019/01/ue4build.cs-notes/


生命是一团欲望,欲望不满足便痛苦,满足便无聊。人生就在痛苦和无聊之间摇摆。──亚瑟·叔本华(Arthur Schopenhauer)《悲观论集卷》