2018-12-14 13:41:00 -05:00
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
2014-03-14 14:13:41 -04:00
using UnrealBuildTool ;
using System ;
using System.IO ;
public class Core : ModuleRules
{
2017-01-30 16:52:08 -05:00
public Core ( ReadOnlyTargetRules Target ) : base ( Target )
2014-03-14 14:13:41 -04:00
{
2016-11-23 15:48:37 -05:00
PrivatePCHHeaderFile = "Private/CorePrivatePCH.h" ;
SharedPCHHeaderFile = "Public/CoreSharedPCH.h" ;
2014-03-14 14:13:41 -04:00
2018-04-26 14:11:04 -04:00
PrivateDependencyModuleNames . Add ( "BuildSettings" ) ;
2019-06-03 15:32:00 -04:00
PublicDependencyModuleNames . Add ( "TraceLog" ) ;
2014-03-14 14:13:41 -04:00
PrivateIncludePaths . AddRange (
new string [ ] {
"Developer/DerivedDataCache/Public" ,
2016-02-05 11:54:00 -05:00
"Runtime/SynthBenchmark/Public" ,
2014-03-14 14:13:41 -04:00
"Runtime/Core/Private" ,
"Runtime/Core/Private/Misc" ,
2017-08-31 12:08:38 -04:00
"Runtime/Core/Private/Internationalization" ,
2014-03-14 14:13:41 -04:00
"Runtime/Core/Private/Internationalization/Cultures" ,
2016-06-09 17:45:44 -04:00
"Runtime/Engine/Public" ,
2014-03-14 14:13:41 -04:00
}
) ;
PrivateIncludePathModuleNames . AddRange (
new string [ ] {
"TargetPlatform" ,
"DerivedDataCache" ,
2017-08-31 12:08:38 -04:00
"InputDevice" ,
"Analytics" ,
2016-04-15 10:04:09 -04:00
"RHI"
2014-03-14 14:13:41 -04:00
}
) ;
2017-07-21 12:42:36 -04:00
if ( Target . bBuildEditor = = true )
2014-04-23 19:19:51 -04:00
{
DynamicallyLoadedModuleNames . Add ( "SourceCodeAccess" ) ;
2017-01-31 15:22:49 -05:00
PrivateIncludePathModuleNames . Add ( "DirectoryWatcher" ) ;
DynamicallyLoadedModuleNames . Add ( "DirectoryWatcher" ) ;
2014-04-23 19:19:51 -04:00
}
2014-03-14 14:13:41 -04:00
if ( ( Target . Platform = = UnrealTargetPlatform . Win64 ) | |
( Target . Platform = = UnrealTargetPlatform . Win32 ) )
{
2017-08-21 15:05:19 -04:00
AddEngineThirdPartyPrivateStaticDependencies ( Target ,
2014-03-14 14:13:41 -04:00
"zlib" ) ;
2017-08-31 12:08:38 -04:00
AddEngineThirdPartyPrivateStaticDependencies ( Target ,
2017-11-16 11:36:35 -05:00
"IntelTBB" ,
"IntelVTune"
2014-03-14 14:13:41 -04:00
) ;
2019-03-04 11:35:49 -05:00
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" ) ;
}
2014-03-14 14:13:41 -04:00
}
2019-06-10 12:22:13 -04:00
else if ( ( Target . Platform = = UnrealTargetPlatform . HoloLens ) )
{
PublicIncludePaths . Add ( "Runtime/Core/Public/HoloLens" ) ;
AddEngineThirdPartyPrivateStaticDependencies ( Target ,
"zlib" ) ;
AddEngineThirdPartyPrivateStaticDependencies ( Target ,
"IntelTBB" ,
"XInput"
) ;
}
2014-03-14 14:13:41 -04:00
else if ( Target . Platform = = UnrealTargetPlatform . Mac )
{
2017-08-21 15:05:19 -04:00
AddEngineThirdPartyPrivateStaticDependencies ( Target ,
2014-03-14 14:13:41 -04:00
"IntelTBB" ,
"zlib" ,
2018-05-01 10:36:33 -04:00
"PLCrashReporter" ,
"rd_route"
2014-03-14 14:13:41 -04:00
) ;
2015-03-02 07:34:19 -05:00
PublicFrameworks . AddRange ( new string [ ] { "Cocoa" , "Carbon" , "IOKit" , "Security" } ) ;
2017-08-31 12:08:38 -04:00
2017-07-21 12:42:36 -04:00
if ( Target . bBuildEditor = = true )
2014-05-29 16:51:30 -04:00
{
PublicAdditionalLibraries . Add ( "/System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/Current/MultitouchSupport" ) ;
}
2014-03-14 14:13:41 -04:00
}
2015-12-10 16:56:55 -05:00
else if ( Target . Platform = = UnrealTargetPlatform . IOS | | Target . Platform = = UnrealTargetPlatform . TVOS )
2014-03-14 14:13:41 -04:00
{
2017-08-21 15:05:19 -04:00
AddEngineThirdPartyPrivateStaticDependencies ( Target ,
2014-03-14 14:13:41 -04:00
"zlib"
) ;
2018-10-03 17:13:29 -04:00
PublicFrameworks . AddRange ( new string [ ] { "UIKit" , "Foundation" , "AudioToolbox" , "AVFoundation" , "GameKit" , "StoreKit" , "CoreVideo" , "CoreMedia" , "CoreGraphics" , "GameController" , "SystemConfiguration" , "DeviceCheck" , "UserNotifications" } ) ;
2015-12-10 16:56:55 -05:00
if ( Target . Platform = = UnrealTargetPlatform . IOS )
{
2018-05-02 22:53:38 -04:00
PublicFrameworks . AddRange ( new string [ ] { "CoreMotion" , "AdSupport" , "WebKit" } ) ;
2017-08-31 12:08:38 -04:00
AddEngineThirdPartyPrivateStaticDependencies ( Target ,
"PLCrashReporter"
) ;
2015-12-10 16:56:55 -05:00
}
2014-03-14 14:13:41 -04:00
2017-08-31 12:08:38 -04:00
PrivateIncludePathModuleNames . Add ( "ApplicationCore" ) ;
2015-12-10 16:56:55 -05:00
bool bSupportAdvertising = Target . Platform = = UnrealTargetPlatform . IOS ;
2014-03-14 14:13:41 -04:00
if ( bSupportAdvertising )
{
2015-12-10 16:56:55 -05:00
PublicFrameworks . AddRange ( new string [ ] { "iAD" } ) ;
2014-03-14 14:13:41 -04:00
}
2019-02-27 11:57:17 -05:00
// export Core symbols for embedded Dlls
ModuleSymbolVisibility = ModuleRules . SymbolVisibility . VisibileForDll ;
2014-03-14 14:13:41 -04:00
}
2018-05-10 14:17:01 -04:00
else if ( Target . IsInPlatformGroup ( UnrealPlatformGroup . Android ) )
2014-03-14 14:13:41 -04:00
{
2017-08-21 15:05:19 -04:00
AddEngineThirdPartyPrivateStaticDependencies ( Target ,
2016-04-15 18:19:26 -04:00
"cxademangle" ,
2014-03-14 14:13:41 -04:00
"zlib"
) ;
}
2018-03-21 11:09:41 -04:00
else if ( Target . IsInPlatformGroup ( UnrealPlatformGroup . Unix ) )
2017-08-31 12:08:38 -04:00
{
2018-03-21 11:09:41 -04:00
PublicIncludePaths . Add ( string . Format ( "Runtime/Core/Public/{0}" , Target . Platform . ToString ( ) ) ) ;
2017-08-21 15:05:19 -04:00
AddEngineThirdPartyPrivateStaticDependencies ( Target ,
2014-03-14 14:13:41 -04:00
"zlib" ,
2018-09-12 15:59:49 -04:00
"jemalloc"
2017-08-31 12:08:38 -04:00
) ;
2014-04-23 16:35:49 -04:00
2014-10-15 13:32:48 -04:00
// Core uses dlopen()
PublicAdditionalLibraries . Add ( "dl" ) ;
2017-08-31 12:08:38 -04:00
}
2017-08-21 15:05:19 -04:00
else if ( Target . Platform = = UnrealTargetPlatform . HTML5 )
{
2017-08-31 12:08:38 -04:00
PrivateDependencyModuleNames . Add ( "HTML5JS" ) ;
PrivateDependencyModuleNames . Add ( "MapPakDownloader" ) ;
}
else if ( Target . Platform = = UnrealTargetPlatform . PS4 )
{
PublicAdditionalLibraries . Add ( "SceRtc_stub_weak" ) ; //ORBIS SDK rtc.h, used in PS4Time.cpp
}
2014-03-14 14:13:41 -04:00
2017-08-21 15:05:19 -04:00
if ( Target . bCompileICU = = true )
2017-08-31 12:08:38 -04:00
{
2016-02-03 15:40:40 -05:00
AddEngineThirdPartyPrivateStaticDependencies ( Target , "ICU" ) ;
2017-08-31 12:08:38 -04:00
}
2017-12-12 18:32:45 -05:00
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.
2014-03-14 14:13:41 -04:00
2017-08-31 12:08:38 -04:00
// If we're compiling with the engine, then add Core's engine dependencies
2017-07-21 12:42:36 -04:00
if ( Target . bCompileAgainstEngine = = true )
2014-03-14 14:13:41 -04:00
{
2017-07-21 12:42:36 -04:00
if ( ! Target . bBuildRequiresCookedData )
2014-03-14 14:13:41 -04:00
{
DynamicallyLoadedModuleNames . AddRange ( new string [ ] { "DerivedDataCache" } ) ;
}
}
2017-08-31 12:08:38 -04:00
2014-03-14 14:13:41 -04:00
// 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 ) ;
2017-12-12 18:32:45 -05:00
PublicDefinitions . Add ( "WITH_VS_PERF_PROFILER=1" ) ;
2014-03-14 14:13:41 -04:00
}
2016-12-13 11:58:16 -05:00
else
{
2017-12-12 18:32:45 -05:00
PublicDefinitions . Add ( "WITH_VS_PERF_PROFILER=0" ) ;
2016-12-13 11:58:16 -05:00
}
2014-03-14 14:13:41 -04:00
}
2019-06-10 12:22:13 -04:00
if ( Target . Platform = = UnrealTargetPlatform . HoloLens )
{
PublicDefinitions . Add ( "WITH_VS_PERF_PROFILER=0" ) ;
}
2017-12-05 21:57:41 -05:00
WhitelistRestrictedFolders . Add ( "Private/NoRedist" ) ;
2014-03-14 14:13:41 -04:00
2017-08-31 12:08:38 -04:00
if ( Target . Platform = = UnrealTargetPlatform . XboxOne )
{
2017-12-12 18:32:45 -05:00
PublicDefinitions . Add ( "WITH_DIRECTXMATH=1" ) ;
2017-08-31 12:08:38 -04:00
}
else if ( ( Target . Platform = = UnrealTargetPlatform . Win64 ) | |
2019-06-10 12:22:13 -04:00
( Target . Platform = = UnrealTargetPlatform . Win32 ) | |
( Target . Platform = = UnrealTargetPlatform . HoloLens ) )
2017-08-31 12:08:38 -04:00
{
2014-03-14 14:13:41 -04:00
// To enable this requires Win8 SDK
2017-12-12 18:32:45 -05:00
PublicDefinitions . Add ( "WITH_DIRECTXMATH=0" ) ; // Enable to test on Win64/32.
2014-03-14 14:13:41 -04:00
2017-08-31 12:08:38 -04:00
//PublicDependencyModuleNames.AddRange( // Enable to test on Win64/32.
2017-08-21 15:05:19 -04:00
// new string[] {
// "DirectXMath"
2017-08-31 12:08:38 -04:00
//});
}
else
{
2017-12-12 18:32:45 -05:00
PublicDefinitions . Add ( "WITH_DIRECTXMATH=0" ) ;
2017-08-31 12:08:38 -04:00
}
2018-05-01 10:36:33 -04:00
// 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 )
{
2019-06-03 15:32:00 -04:00
if ( Target . Platform = = UnrealTargetPlatform . Mac | | Target . Platform = = UnrealTargetPlatform . Linux | | Target . Platform = = UnrealTargetPlatform . Win64 )
2019-05-24 11:51:54 -04:00
// 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 ;
}
2018-05-01 10:36:33 -04:00
}
PublicDefinitions . Add ( "WITH_MALLOC_STOMP=" + ( bWithMallocStomp ? "1" : "0" ) ) ;
2019-01-08 11:38:48 -05:00
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" ) ) ;
2017-08-31 12:08:38 -04:00
}
2014-03-14 14:13:41 -04:00
}