Files
UnrealEngineUWP/Engine/Source/Runtime/Core/Core.Build.cs
Joakim Lindqvist d26625d39d Updated module build configurations to follow our updated guidelines on using a library, you should always specify the full path to the library if you know it (in PublicAdditionalLibraries). This allows UBT to do up to date checking of the module and is faster.
If you still need to old behavior of searching for a library we use the new PublicSystemLibraries instead (used very sparingly).

Also updated conventions on importing Android libraries to use the newly introduced Android Architecture instead, which is always set to a valid architecuture (unlike Target.Architecture for the general case)

Lastly I updated some build.cs files that were doing filesystem enumeration or copying as they were being parsed, this is highly discouraged (partially because we cache filesystem operations but also it adds a cost to something we expect to be very fast). Any operations like this should be done as part of the build if they have to be done at all.

#rb none

[CL 7918851 by Joakim Lindqvist in Dev-Build branch]
2019-08-09 03:48:12 -04:00

223 lines
7.6 KiB
C#

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
using System;
using System.IO;
public class Core : ModuleRules
{
public Core(ReadOnlyTargetRules Target) : base(Target)
{
PrivatePCHHeaderFile = "Private/CorePrivatePCH.h";
SharedPCHHeaderFile = "Public/CoreSharedPCH.h";
PrivateDependencyModuleNames.Add("BuildSettings");
PublicDependencyModuleNames.Add("TraceLog");
PrivateIncludePaths.AddRange(
new string[] {
"Developer/DerivedDataCache/Public",
"Runtime/SynthBenchmark/Public",
"Runtime/Core/Private",
"Runtime/Core/Private/Misc",
"Runtime/Core/Private/Internationalization",
"Runtime/Core/Private/Internationalization/Cultures",
"Runtime/Engine/Public",
}
);
PrivateIncludePathModuleNames.AddRange(
new string[] {
"TargetPlatform",
"DerivedDataCache",
"InputDevice",
"Analytics",
"RHI"
}
);
if (Target.bBuildEditor == true)
{
DynamicallyLoadedModuleNames.Add("SourceCodeAccess");
PrivateIncludePathModuleNames.Add("DirectoryWatcher");
DynamicallyLoadedModuleNames.Add("DirectoryWatcher");
}
if ((Target.Platform == UnrealTargetPlatform.Win64) ||
(Target.Platform == UnrealTargetPlatform.Win32))
{
AddEngineThirdPartyPrivateStaticDependencies(Target,
"zlib");
AddEngineThirdPartyPrivateStaticDependencies(Target,
"IntelTBB",
"IntelVTune"
);
if(Target.Platform == UnrealTargetPlatform.Win64 && Target.WindowsPlatform.bUseBundledDbgHelp)
{
PublicDelayLoadDLLs.Add("DBGHELP.DLL");
PrivateDefinitions.Add("USE_BUNDLED_DBGHELP=1");
RuntimeDependencies.Add("$(EngineDir)/Binaries/ThirdParty/DbgHelp/dbghelp.dll");
}
else
{
PrivateDefinitions.Add("USE_BUNDLED_DBGHELP=0");
}
}
else if ((Target.Platform == UnrealTargetPlatform.HoloLens))
{
PublicIncludePaths.Add("Runtime/Core/Public/HoloLens");
AddEngineThirdPartyPrivateStaticDependencies(Target,
"zlib");
AddEngineThirdPartyPrivateStaticDependencies(Target,
"IntelTBB",
"XInput"
);
}
else if (Target.Platform == UnrealTargetPlatform.Mac)
{
AddEngineThirdPartyPrivateStaticDependencies(Target,
"IntelTBB",
"zlib",
"PLCrashReporter",
"rd_route"
);
PublicFrameworks.AddRange(new string[] { "Cocoa", "Carbon", "IOKit", "Security" });
if (Target.bBuildEditor == true)
{
PublicAdditionalLibraries.Add("/System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/Current/MultitouchSupport");
}
}
else if (Target.Platform == UnrealTargetPlatform.IOS || Target.Platform == UnrealTargetPlatform.TVOS)
{
AddEngineThirdPartyPrivateStaticDependencies(Target,
"zlib"
);
PublicFrameworks.AddRange(new string[] { "UIKit", "Foundation", "AudioToolbox", "AVFoundation", "GameKit", "StoreKit", "CoreVideo", "CoreMedia", "CoreGraphics", "GameController", "SystemConfiguration", "DeviceCheck", "UserNotifications" });
if (Target.Platform == UnrealTargetPlatform.IOS)
{
PublicFrameworks.AddRange(new string[] { "CoreMotion", "AdSupport", "WebKit" });
AddEngineThirdPartyPrivateStaticDependencies(Target,
"PLCrashReporter"
);
}
PrivateIncludePathModuleNames.Add("ApplicationCore");
bool bSupportAdvertising = Target.Platform == UnrealTargetPlatform.IOS;
if (bSupportAdvertising)
{
PublicFrameworks.AddRange(new string[] { "iAD" });
}
// export Core symbols for embedded Dlls
ModuleSymbolVisibility = ModuleRules.SymbolVisibility.VisibileForDll;
}
else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Android))
{
AddEngineThirdPartyPrivateStaticDependencies(Target,
"cxademangle",
"zlib"
);
}
else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
{
PublicIncludePaths.Add(string.Format("Runtime/Core/Public/{0}", Target.Platform.ToString()));
AddEngineThirdPartyPrivateStaticDependencies(Target,
"zlib",
"jemalloc"
);
// Core uses dlopen()
PublicSystemLibraries.Add("dl");
}
else if (Target.Platform == UnrealTargetPlatform.HTML5)
{
PrivateDependencyModuleNames.Add("HTML5JS");
PrivateDependencyModuleNames.Add("MapPakDownloader");
}
else if (Target.Platform == UnrealTargetPlatform.PS4)
{
PublicSystemLibraries.Add("SceRtc_stub_weak"); //ORBIS SDK rtc.h, used in PS4Time.cpp
}
if ( Target.bCompileICU == true )
{
AddEngineThirdPartyPrivateStaticDependencies(Target, "ICU");
}
PublicDefinitions.Add("UE_ENABLE_ICU=" + (Target.bCompileICU ? "1" : "0")); // Enable/disable (=1/=0) ICU usage in the codebase. NOTE: This flag is for use while integrating ICU and will be removed afterward.
// If we're compiling with the engine, then add Core's engine dependencies
if (Target.bCompileAgainstEngine == true)
{
if (!Target.bBuildRequiresCookedData)
{
DynamicallyLoadedModuleNames.AddRange(new string[] { "DerivedDataCache" });
}
}
// On Windows platform, VSPerfExternalProfiler.cpp needs access to "VSPerf.h". This header is included with Visual Studio, but it's not in a standard include path.
if( Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Win64 )
{
var VisualStudioVersionNumber = "11.0";
var SubFolderName = ( Target.Platform == UnrealTargetPlatform.Win64 ) ? "x64/PerfSDK" : "PerfSDK";
string PerfIncludeDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), String.Format("Microsoft Visual Studio {0}/Team Tools/Performance Tools/{1}", VisualStudioVersionNumber, SubFolderName));
if (File.Exists(Path.Combine(PerfIncludeDirectory, "VSPerf.h")))
{
PrivateIncludePaths.Add(PerfIncludeDirectory);
PublicDefinitions.Add("WITH_VS_PERF_PROFILER=1");
}
else
{
PublicDefinitions.Add("WITH_VS_PERF_PROFILER=0");
}
}
if( Target.Platform == UnrealTargetPlatform.HoloLens)
{
PublicDefinitions.Add("WITH_VS_PERF_PROFILER=0");
}
WhitelistRestrictedFolders.Add("Private/NoRedist");
if (Target.Platform == UnrealTargetPlatform.XboxOne ||
(Target.bWithDirectXMath && (Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.Win32)))
{
PublicDefinitions.Add("WITH_DIRECTXMATH=1");
}
else
{
PublicDefinitions.Add("WITH_DIRECTXMATH=0");
}
// Decide if validating memory allocator (aka MallocStomp) can be used on the current platform.
// Run-time validation must be enabled through '-stompmalloc' command line argument.
bool bWithMallocStomp = false;
if (Target.Configuration != UnrealTargetConfiguration.Shipping)
{
if (Target.Platform == UnrealTargetPlatform.Mac || Target.Platform == UnrealTargetPlatform.Linux || Target.Platform == UnrealTargetPlatform.Win64)
// Target.Platform == UnrealTargetPlatform.Win32: // 32-bit windows can technically be supported, but will likely run out of virtual memory space quickly
// Target.Platform == UnrealTargetPlatform.XboxOne: // XboxOne could be supported, as it's similar enough to Win64
{
bWithMallocStomp = true;
}
}
PublicDefinitions.Add("WITH_MALLOC_STOMP=" + (bWithMallocStomp ? "1" : "0"));
PrivateDefinitions.Add("PLATFORM_COMPILER_OPTIMIZATION_LTCG=" + (Target.bAllowLTCG ? "1" : "0"));
PrivateDefinitions.Add("PLATFORM_COMPILER_OPTIMIZATION_PG=" + (Target.bPGOOptimize ? "1" : "0"));
PrivateDefinitions.Add("PLATFORM_COMPILER_OPTIMIZATION_PG_PROFILING=" + (Target.bPGOProfile ? "1" : "0"));
}
}