// Copyright Epic Games, Inc. All Rights Reserved.
using System.Collections.Generic;
using System.Linq;
using System.IO.Enumeration;
using EpicGames.Core;
using UnrealBuildBase;
using System;
using System.Diagnostics.CodeAnalysis;
namespace UnrealBuildTool
{
///
/// Compiler configuration. This controls whether to use define debug macros and other compiler settings. Note that optimization level should be based on the bOptimizeCode variable rather than
/// this setting, so it can be modified on a per-module basis without introducing an incompatibility between object files or PCHs.
///
enum CppConfiguration
{
Debug,
Development,
Shipping
}
///
/// Specifies which language standard to use. This enum should be kept in order, so that toolchains can check whether the requested setting is >= values that they support.
///
public enum CppStandardVersion
{
///
/// Obsolete C++14 standard. No longer allowed, code will not compile with this version.
///
[Obsolete("C++14 is no longer allowed, code will not compile with this version")]
Cpp14,
///
/// Obsolete C++17 standard. No longer allowed, code will not compile with this version.
///
[Obsolete("C++17 is no longer allowed, code will not compile with this version")]
Cpp17,
///
/// C++20 standard
///
Cpp20,
///
/// C++23 standard. Experimental, compiler support is currently limited.
///
Cpp23,
///
/// Latest standard supported by the compiler
///
Latest,
///
/// Use the default standard version (BuildSettingsVersion.V1-V3: Cpp17, V4: Cpp20)
///
Default = Cpp20,
///
/// Use the default standard version for engine modules
///
EngineDefault = Cpp20,
///
/// The minimum allowed C++ standard version. Lower values than this will cause a build error.
///
Minimum = Cpp20,
}
///
/// Specifies which C language standard to use. This enum should be kept in order, so that toolchains can check whether the requested setting is >= values that they support.
///
public enum CStandardVersion
{
///
/// Supports no additional standard version flag
///
None,
///
/// Supports C89
///
C89,
///
/// Supports C99
///
C99,
///
/// Supports C11
///
C11,
///
/// Supports C17
///
C17,
///
/// Latest standard supported by the compiler
///
Latest,
///
/// Use the default standard version
///
Default = None,
}
///
/// Specifies the architecture for code generation on x64 for windows platforms.
/// 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.
/// For more details please see https://learn.microsoft.com/en-us/cpp/build/reference/arch-x64
///
public enum MinimumCpuArchitectureX64
{
///
/// No minimum architecure
///
None,
///
/// Enables the use of Intel Advanced Vector Extensions instructions
///
AVX,
///
/// Enables the use of Intel Advanced Vector Extensions 2 instructions
///
AVX2,
///
/// Enables the use of Intel Advanced Vector Extensions 512 instructions
///
AVX512,
///
/// Use the default minimum architecture
///
Default = None,
}
///
/// Target ARM64 CPU for codegen. This defines different ARM ISA and extension targets
///
public enum Arm64TargetCpuType
{
///
/// Default ARMv8.0-A ISA target CPU, supported by every 64 bit ARM CPU
///
Default,
///
/// AWS Graviton2 CPU - ARM Neoverse N1 uArch with ARMv8.2-A ISA + FP16 + rcpc + dotprod + crypto extensions
///
Graviton2,
///
/// AWS Graviton3 CPU - ARM Neoverse V1 uArch with AMRv8.4-A ISA + SVE + bf16 + rng + crypto extensions
///
Graviton3,
}
///
/// The optimization level that may be compilation targets for C# files.
///
enum CSharpTargetConfiguration
{
Debug,
Development,
}
///
/// The possible interactions between a precompiled header and a C++ file being compiled.
///
enum PrecompiledHeaderAction
{
None,
Include,
Create
}
///
/// Encapsulates the compilation output of compiling a set of C++ files.
///
class CPPOutput
{
public List ObjectFiles = new List();
public List CompiledModuleInterfaces = new List();
public List GeneratedHeaderFiles = new List();
public FileItem? PrecompiledHeaderFile = null;
public Dictionary PerArchPrecompiledHeaderFiles = new();
public void Merge(CPPOutput Other, UnrealArch Architecture)
{
ObjectFiles.AddRange(Other.ObjectFiles);
CompiledModuleInterfaces.AddRange(Other.CompiledModuleInterfaces);
GeneratedHeaderFiles.AddRange(Other.GeneratedHeaderFiles);
ObjectFiles.AddRange(Other.ObjectFiles);
if (Other.PrecompiledHeaderFile != null)
{
PerArchPrecompiledHeaderFiles[Architecture] = Other.PrecompiledHeaderFile;
}
}
public FileItem? GetPrecompiledHeaderFile(UnrealArch Architecture)
{
if (PerArchPrecompiledHeaderFiles != null)
{
PerArchPrecompiledHeaderFiles.TryGetValue(Architecture, out FileItem? PerArchPrecompiledHeaderFile);
if (PerArchPrecompiledHeaderFile != null)
{
return PerArchPrecompiledHeaderFile;
}
}
return PrecompiledHeaderFile;
}
}
///
/// Encapsulates the environment that a C++ file is compiled in.
///
class CppCompileEnvironment
{
///
/// The platform to be compiled/linked for.
///
public readonly UnrealTargetPlatform Platform;
///
/// The configuration to be compiled/linked for.
///
public readonly CppConfiguration Configuration;
///
/// The architecture that is being compiled/linked (empty string by default)
///
public UnrealArchitectures Architectures;
///
/// Gets the Architecture in the normal case where there is a single Architecture in Architectures
///
public UnrealArch Architecture => Architectures.SingleArchitecture;
///
/// Cache of source file metadata
///
public readonly SourceFileMetadataCache MetadataCache;
///
/// Root paths for this environment. Used for Clang VFS and UBA
///
public readonly CppRootPaths RootPaths;
///
/// Templates for shared precompiled headers
///
public readonly List SharedPCHs;
///
/// The name of the header file which is precompiled.
///
public FileReference? PrecompiledHeaderIncludeFilename = null;
///
/// Whether the compilation should create, use, or do nothing with the precompiled header.
///
public PrecompiledHeaderAction PrecompiledHeaderAction = PrecompiledHeaderAction.None;
///
/// Will replace pch with ifc and use header units instead
///
public bool bUseHeaderUnitsForPch = false;
///
/// Whether artifacts from this compile are shared with other targets. If so, we should not apply any target-wide modifications to the compile environment.
///
public bool bUseSharedBuildEnvironment;
///
/// Use run time type information
///
public bool bUseRTTI = false;
///
/// Whether to direct MSVC to remove unreferenced COMDAT functions and data.
///
/// zc-inline-remove-unreferenced-comdat
public bool bVcRemoveUnreferencedComdat = true;
///
/// Use Position Independent Executable (PIE). Has an overhead cost
///
public bool bUsePIE = false;
///
/// Use Stack Protection. Has an overhead cost
///
public bool bUseStackProtection = false;
///
/// Enable inlining.
///
public bool bUseInlining = false;
///
/// Whether to compile ISPC files.
///
public bool bCompileISPC = false;
///
/// Enable buffer security checks. This should usually be enabled as it prevents severe security risks.
///
public bool bEnableBufferSecurityChecks = true;
///
/// Whether the AutoRTFM compiler is being used or not.
///
public bool bUseAutoRTFMCompiler = false;
///
/// Disables AutoRTFM instrumentation to this cpp file only when AutoRTFMCompiler is enabled
///
public bool bDisableAutoRTFMInstrumentation = false;
///
/// Whether AutoRTFM instrumentation is enabled or not.
///
public bool bEnableAutoRTFMInstrumentation => bUseAutoRTFMCompiler && !bDisableAutoRTFMInstrumentation;
///
/// Whether AutoRTFM verification is enabled or not.
///
public bool bEnableAutoRTFMVerification = false;
///
/// Whether we should run an extra LLVM verification pass after the AutoRTFM compiler pass.
///
public bool bAutoRTFMVerify = false;
///
/// Whether we should link closed function declarations statically.
///
public bool bAutoRTFMClosedStaticLinkage = false;
///
/// If unity builds are enabled this can be used to override if this specific module will build using Unity.
/// This is set using the per module configurations in BuildConfiguration.
///
public bool bUseUnity = false;
///
/// 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
///
public int MinSourceFilesForUnityBuildOverride = 0;
///
/// The minimum number of files that must use a pre-compiled header before it will be created and used.
///
public int MinFilesUsingPrecompiledHeaderOverride = 0;
///
/// Module uses a #import so must be built locally when compiling with SN-DBS
///
public bool bBuildLocallyWithSNDBS = false;
///
/// Whether to retain frame pointers
///
public bool bRetainFramePointers = true;
///
/// Enable exception handling
///
public bool bEnableExceptions = false;
///
/// Enable objective C exception handling
///
public bool bEnableObjCExceptions = false;
///
/// Enable objective C automatic reference counting (ARC)
/// If you set this to true you should not use shared PCHs for this module. The engine won't be extensively using ARC in the short term
/// Not doing this will result in a compile errors because shared PCHs were compiled with different flags than consumer
///
public bool bEnableObjCAutomaticReferenceCounting = false;
///
/// How to treat any warnings in the code
///
public WarningLevel DefaultWarningLevel = WarningLevel.Warning;
///
/// The compiler warnings associacted with the compile environment.
///
public CppCompileWarnings CppCompileWarnings;
///
/// Whether to treat all warnings as errors
///
public bool bWarningsAsErrors = false;
///
/// Whether to disable all static analysis - Clang, MSVC, PVS-Studio.
///
public bool bDisableStaticAnalysis = false;
///
/// Enable additional analyzer extension warnings using the EspXEngine plugin. This is only supported for MSVC.
/// See https://learn.microsoft.com/en-us/cpp/code-quality/using-the-cpp-core-guidelines-checkers
/// This will add a large number of warnings by default. It's recommended to use StaticAnalyzerRulesets if this is enabled.
///
public bool bStaticAnalyzerExtensions = false;
///
/// The static analyzer rulesets that should be used to filter warnings. This is only supported for MSVC.
/// See https://learn.microsoft.com/en-us/cpp/code-quality/using-rule-sets-to-specify-the-cpp-rules-to-run
///
public HashSet StaticAnalyzerRulesets = new HashSet();
///
/// The static analyzer checkers that should be enabled rather than the defaults. This is only supported for Clang.
///
public HashSet StaticAnalyzerCheckers = new HashSet();
///
/// The static analyzer default checkers that should be disabled. Unused if StaticAnalyzerCheckers is populated. This is only supported for Clang.
///
public HashSet StaticAnalyzerDisabledCheckers = new HashSet();
///
/// The static analyzer non-default checkers that should be enabled. Unused if StaticAnalyzerCheckers is populated. This is only supported for Clang.
///
public HashSet StaticAnalyzerAdditionalCheckers = new HashSet();
///
/// The PVS Studio analysis warnings that should be disabled.
///
public HashSet StaticAnalyzerPVSDisabledErrors = new();
///
/// True if compiler optimizations should be enabled. This setting is distinct from the configuration (see CPPTargetConfiguration).
///
public bool bOptimizeCode = false;
///
/// True if the compilation should produce tracing output for code coverage.
///
public bool bCodeCoverage = false;
///
/// Allows to fine tune optimizations level for speed and\or code size
///
public OptimizationMode OptimizationLevel = OptimizationMode.Speed;
///
/// Determines the FP semantics.
///
public FPSemanticsMode FPSemantics = FPSemanticsMode.Default;
///
/// True if debug info should be created.
///
public bool bCreateDebugInfo = true;
///
/// True if debug info should only generate line number tables (clang)
///
public bool bDebugLineTablesOnly = false;
///
/// True if we're compiling .cpp files that will go into a library (.lib file)
///
public bool bIsBuildingLibrary = false;
///
/// True if we're compiling a DLL
///
public bool bIsBuildingDLL = false;
///
/// Whether we should compile using the statically-linked CRT. This is not widely supported for the whole engine, but is required for programs that need to run without dependencies.
///
public bool bUseStaticCRT = false;
///
/// Whether to use the debug CRT in debug configurations
///
public bool bUseDebugCRT = false;
///
/// Whether to omit frame pointers or not. Disabling is useful for e.g. memory profiling on the PC
///
public bool bOmitFramePointers = true;
///
/// Whether we should compile with support for OS X 10.9 Mavericks. Used for some tools that we need to be compatible with this version of OS X.
///
public bool bEnableOSX109Support = false;
///
/// Whether PDB files should be used for Visual C++ builds.
///
public bool bUsePDBFiles = false;
///
/// Whether to just preprocess source files
///
public bool bPreprocessOnly = false;
///
/// Should an assembly file be generated while compiling. Works exclusively on MSVC compilers for now.
///
public bool bWithAssembly = false;
///
/// Whether to support edit and continue. Only works on Microsoft compilers in 32-bit compiles.
///
public bool bSupportEditAndContinue;
///
/// Whether to use incremental linking or not.
///
public bool bUseIncrementalLinking;
///
/// Whether to allow the use of LTCG (link time code generation)
///
public bool bAllowLTCG;
///
/// Whether to enable Profile Guided Optimization (PGO) instrumentation in this build.
///
public bool bPGOProfile;
///
/// Whether to optimize this build with Profile Guided Optimization (PGO).
///
public bool bPGOOptimize;
///
/// Platform specific directory where PGO profiling data is stored.
///
public string? PGODirectory;
///
/// Platform specific filename where PGO profiling data is saved.
///
public string? PGOFilenamePrefix;
///
/// Whether to log detailed timing info from the compiler
///
public bool bPrintTimingInfo;
///
/// When enabled, allows XGE to compile pre-compiled header files on remote machines. Otherwise, PCHs are always generated locally.
///
public bool bAllowRemotelyCompiledPCHs = false;
///
/// Ordered list of include paths for the module
///
public HashSet UserIncludePaths;
///
/// The include paths where changes to contained files won't cause dependent C++ source files to
/// be recompiled, unless BuildConfiguration.bCheckSystemHeadersForModification==true.
///
public HashSet SystemIncludePaths;
///
/// The include paths which were previously in UserIncludePaths, but are now in a shared response file, persisted in the environment for validation.
/// Do not add to this set unless a shared response is in use, and only when removing those headers from UserIncludePaths.
///
public HashSet SharedUserIncludePaths;
///
/// The include paths which were previously in SystemIncludePaths, but are now in a shared response file, persisted in the environment for validation.
/// Do not add to this set unless a shared response is in use, and only when removing those headers from SystemIncludePaths.
///
public HashSet SharedSystemIncludePaths;
///
/// Enumerable of all possible include paths
///
public IEnumerable AllIncludePath => SharedUserIncludePaths.Concat(UserIncludePaths).Concat(SharedSystemIncludePaths).Concat(SystemIncludePaths);
///
/// List of paths to search for compiled module interface (*.ifc) files
///
public HashSet ModuleInterfacePaths;
///
/// Whether headers in system paths should be checked for modification when determining outdated actions.
///
public bool bCheckSystemHeadersForModification;
///
/// List of header files to force include
///
public List ForceIncludeFiles = new List();
///
/// List of files that need to be up to date before compile can proceed
///
public List AdditionalPrerequisites = new List();
///
/// A dictionary of the source file items and the inlined gen.cpp files contained in it
///
public Dictionary> FileInlineGenCPPMap = new();
///
/// Non-default naming conventions that generated CPP files can have (this uses a filter to check the file name for matches)
///
public List ExtraGeneratedCPPFileTypes = new List();
///
/// FileItems with colliding names. (Which means they would overwrite each other in intermediate folder
///
public HashSet? CollidingNames;
///
/// The C++ preprocessor definitions to use.
///
public List Definitions = new List();
///
/// Additional response files that will be used by main response file
///
public List AdditionalResponseFiles = new();
///
/// Whether the compile environment has a response file in AdditionalResponseFiles that contains global compiler arguments.
///
public bool bHasSharedResponseFile = false;
///
/// Additional arguments to pass to the compiler.
///
public string AdditionalArguments = "";
///
/// A list of additional frameworks whose include paths are needed.
///
public List AdditionalFrameworks = new List();
///
/// A dictionary of PCH files for multiple architectures
///
public Dictionary? PerArchPrecompiledHeaderFiles => PCHInstance?.Output.PerArchPrecompiledHeaderFiles;
///
/// The instance containing the precompiled header data.
///
public PrecompiledHeaderInstance? PCHInstance = null;
///
/// The file containing the precompiled header data.
///
public FileItem? PrecompiledHeaderFile => GetPrecompiledHeaderFile(PCHInstance);
///
/// The parent PCH instance used when creating this PCH.
///
public PrecompiledHeaderInstance? ParentPCHInstance = null;
///
/// The parent's PCH header file.
///
public FileItem? ParentPrecompiledHeaderFile => GetPrecompiledHeaderFile(ParentPCHInstance);
///
/// True if a single PRecompiledHeader exists, or at least one PerArchPrecompiledHeaderFile exists
///
public bool bHasPrecompiledHeader => PrecompiledHeaderAction == PrecompiledHeaderAction.Include;
///
/// Whether or not UHT is being built
///
public bool bHackHeaderGenerator;
///
/// Whether to hide symbols by default
///
public bool bHideSymbolsByDefault = true;
///
/// Whether this environment should be treated as an engine module.
///
public bool bTreatAsEngineModule;
///
/// Which C++ standard to support for engine modules. CppStandard will be set to this for engine modules and CppStandardEngine should not be checked in any toolchain. May not be compatible with all platforms.
///
public CppStandardVersion CppStandardEngine = CppStandardVersion.EngineDefault;
///
/// Which C++ standard to support. May not be compatible with all platforms.
///
public CppStandardVersion CppStandard = CppStandardVersion.Default;
///
/// Which C standard to support. May not be compatible with all platforms.
///
public CStandardVersion CStandard = CStandardVersion.Default;
///
/// Direct the compiler to generate AVX instructions wherever SSE or AVX intrinsics are used.
/// 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.
///
public MinimumCpuArchitectureX64 MinCpuArchX64 = MinimumCpuArchitectureX64.Default;
///
/// Select a minimum ARM64 target CPU. This will change what ARMv8(9)-A ISA + extension code will be compiled for.
/// Changing it from default will guarantee not to work on all ARM64 CPUs.
/// Currently supported by clang compiler only
///
public Arm64TargetCpuType MinArm64CpuTarget = Arm64TargetCpuType.Default;
///
/// The amount of the stack usage to report static analysis warnings.
///
public int AnalyzeStackSizeWarning = 300000;
///
/// Enable C++ coroutine support.
/// For MSVC, adds "/await:strict" to the command line. Program should #include <coroutine>
/// For Clang, adds "-fcoroutines-ts" to the command line. Program should #include <experimental/coroutine> (not supported in every clang toolchain)
///
public bool bEnableCoroutines = false;
///
/// What version of include order specified by the module rules. Used to determine shared PCH variants.
///
public EngineIncludeOrderVersion IncludeOrderVersion = EngineIncludeOrderVersion.Latest;
///
/// Set flags for determinstic compiles.
///
public bool bDeterministic;
///
/// Set flags for determinstic compile warnings.
///
public WarningLevel DeterministicWarningLevel
{
get => CppCompileWarnings.DeterministicWarningLevel;
set => CppCompileWarnings.DeterministicWarningLevel = value;
}
///
/// Emits compilation errors for incorrect UE_LOG format strings.
///
public bool bValidateFormatStrings = true;
///
/// Emits deprecated warnings\errors for internal API usage for non-engine modules.
///
public bool bValidateInternalApi = false;
///
/// Emits deprecated warnings\errors for experimental API usage for non-engine modules.
///
public bool bValidateExperimentalApi = false;
///
/// Directory where to put crash report files for platforms that support it
///
public string? CrashDiagnosticDirectory;
///
/// File to use as an LLVM FPass Plugin:
/// 'clang -fpass-plugin=[FPassPlugin]'
///
public List FPassPlugins = new();
///
/// Default constructor.
///
public CppCompileEnvironment(UnrealTargetPlatform Platform, CppConfiguration Configuration, UnrealArchitectures Architectures, SourceFileMetadataCache MetadataCache)
{
this.Platform = Platform;
this.Configuration = Configuration;
this.Architectures = Architectures;
this.MetadataCache = MetadataCache;
RootPaths = new();
SharedPCHs = new List();
UserIncludePaths = new HashSet();
SystemIncludePaths = new HashSet();
SharedUserIncludePaths = new HashSet();
SharedSystemIncludePaths = new HashSet();
ModuleInterfacePaths = new HashSet();
CppCompileWarnings = new CppCompileWarnings();
}
///
/// Copy constructor.
///
/// Environment to copy settings from
public CppCompileEnvironment(CppCompileEnvironment Other)
{
Platform = Other.Platform;
Configuration = Other.Configuration;
Architectures = new(Other.Architectures);
MetadataCache = Other.MetadataCache;
RootPaths = new(Other.RootPaths);
SharedPCHs = Other.SharedPCHs;
PrecompiledHeaderIncludeFilename = Other.PrecompiledHeaderIncludeFilename;
PrecompiledHeaderAction = Other.PrecompiledHeaderAction;
bUseSharedBuildEnvironment = Other.bUseSharedBuildEnvironment;
bUseRTTI = Other.bUseRTTI;
bVcRemoveUnreferencedComdat = Other.bVcRemoveUnreferencedComdat;
bUsePIE = Other.bUsePIE;
bUseStackProtection = Other.bUseStackProtection;
bUseInlining = Other.bUseInlining;
bCompileISPC = Other.bCompileISPC;
bUseUnity = Other.bUseUnity;
MinSourceFilesForUnityBuildOverride = Other.MinSourceFilesForUnityBuildOverride;
MinFilesUsingPrecompiledHeaderOverride = Other.MinFilesUsingPrecompiledHeaderOverride;
bBuildLocallyWithSNDBS = Other.bBuildLocallyWithSNDBS;
bRetainFramePointers = Other.bRetainFramePointers;
bEnableExceptions = Other.bEnableExceptions;
bEnableObjCExceptions = Other.bEnableObjCExceptions;
bEnableObjCAutomaticReferenceCounting = Other.bEnableObjCAutomaticReferenceCounting;
DefaultWarningLevel = Other.DefaultWarningLevel;
CppCompileWarnings = CppCompileWarnings.CreateShallowCopy(Other.CppCompileWarnings);
bWarningsAsErrors = Other.bWarningsAsErrors;
bDisableStaticAnalysis = Other.bDisableStaticAnalysis;
StaticAnalyzerCheckers = new HashSet(Other.StaticAnalyzerCheckers);
StaticAnalyzerDisabledCheckers = new HashSet(Other.StaticAnalyzerDisabledCheckers);
StaticAnalyzerAdditionalCheckers = new HashSet(Other.StaticAnalyzerAdditionalCheckers);
StaticAnalyzerPVSDisabledErrors = new HashSet(Other.StaticAnalyzerPVSDisabledErrors);
bStaticAnalyzerExtensions = Other.bStaticAnalyzerExtensions;
StaticAnalyzerRulesets = new HashSet(Other.StaticAnalyzerRulesets);
bOptimizeCode = Other.bOptimizeCode;
bUseAutoRTFMCompiler = Other.bUseAutoRTFMCompiler;
bDisableAutoRTFMInstrumentation = Other.bDisableAutoRTFMInstrumentation;
bEnableAutoRTFMVerification = Other.bEnableAutoRTFMVerification;
bAutoRTFMVerify = Other.bAutoRTFMVerify;
bAutoRTFMClosedStaticLinkage = Other.bAutoRTFMClosedStaticLinkage;
bCodeCoverage = Other.bCodeCoverage;
OptimizationLevel = Other.OptimizationLevel;
FPSemantics = Other.FPSemantics;
bCreateDebugInfo = Other.bCreateDebugInfo;
bDebugLineTablesOnly = Other.bDebugLineTablesOnly;
bIsBuildingLibrary = Other.bIsBuildingLibrary;
bIsBuildingDLL = Other.bIsBuildingDLL;
bUseStaticCRT = Other.bUseStaticCRT;
bUseDebugCRT = Other.bUseDebugCRT;
bOmitFramePointers = Other.bOmitFramePointers;
bEnableOSX109Support = Other.bEnableOSX109Support;
bUsePDBFiles = Other.bUsePDBFiles;
bPreprocessOnly = Other.bPreprocessOnly;
bWithAssembly = Other.bWithAssembly;
bSupportEditAndContinue = Other.bSupportEditAndContinue;
bUseIncrementalLinking = Other.bUseIncrementalLinking;
bAllowLTCG = Other.bAllowLTCG;
bPGOOptimize = Other.bPGOOptimize;
bPGOProfile = Other.bPGOProfile;
PGOFilenamePrefix = Other.PGOFilenamePrefix;
PGODirectory = Other.PGODirectory;
bPrintTimingInfo = Other.bPrintTimingInfo;
bAllowRemotelyCompiledPCHs = Other.bAllowRemotelyCompiledPCHs;
bUseHeaderUnitsForPch = Other.bUseHeaderUnitsForPch;
UserIncludePaths = new HashSet(Other.UserIncludePaths);
SystemIncludePaths = new HashSet(Other.SystemIncludePaths);
SharedUserIncludePaths = new HashSet(Other.SharedUserIncludePaths);
SharedSystemIncludePaths = new HashSet(Other.SharedSystemIncludePaths);
ModuleInterfacePaths = new HashSet(Other.ModuleInterfacePaths);
bCheckSystemHeadersForModification = Other.bCheckSystemHeadersForModification;
ForceIncludeFiles.AddRange(Other.ForceIncludeFiles);
AdditionalPrerequisites.AddRange(Other.AdditionalPrerequisites);
ExtraGeneratedCPPFileTypes = Other.ExtraGeneratedCPPFileTypes;
CollidingNames = Other.CollidingNames;
FileInlineGenCPPMap = new Dictionary>(Other.FileInlineGenCPPMap);
Definitions.AddRange(Other.Definitions);
AdditionalResponseFiles.AddRange(Other.AdditionalResponseFiles);
AdditionalArguments = Other.AdditionalArguments;
AdditionalFrameworks.AddRange(Other.AdditionalFrameworks);
PCHInstance = Other.PCHInstance;
ParentPCHInstance = Other.ParentPCHInstance;
bHackHeaderGenerator = Other.bHackHeaderGenerator;
bHideSymbolsByDefault = Other.bHideSymbolsByDefault;
bTreatAsEngineModule = Other.bTreatAsEngineModule;
CppStandardEngine = Other.CppStandardEngine;
CppStandard = Other.CppStandard;
CStandard = Other.CStandard;
MinCpuArchX64 = Other.MinCpuArchX64;
MinArm64CpuTarget = Other.MinArm64CpuTarget;
bEnableCoroutines = Other.bEnableCoroutines;
IncludeOrderVersion = Other.IncludeOrderVersion;
bDeterministic = Other.bDeterministic;
CrashDiagnosticDirectory = Other.CrashDiagnosticDirectory;
bValidateFormatStrings = Other.bValidateFormatStrings;
bValidateInternalApi = Other.bValidateInternalApi;
bValidateExperimentalApi = Other.bValidateExperimentalApi;
FPassPlugins = Other.FPassPlugins;
}
public CppCompileEnvironment(CppCompileEnvironment Other, UnrealArch OverrideArchitecture)
: this(Other)
{
Architectures = new UnrealArchitectures(OverrideArchitecture);
}
private FileItem? GetPrecompiledHeaderFile(PrecompiledHeaderInstance? Instance)
{
return Instance?.Output.GetPrecompiledHeaderFile(Architectures.SingleArchitecture);
}
public bool FileMatchesExtraGeneratedCPPTypes(string FileName)
{
foreach (string fileFilter in ExtraGeneratedCPPFileTypes)
{
if (FileSystemName.MatchesSimpleExpression(fileFilter, FileName, true))
{
return true;
}
}
return false;
}
}
}