2016-01-07 08:17:16 -05:00
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
2014-03-14 14:13:41 -04:00
using System ;
using System.Collections.Generic ;
using System.Text.RegularExpressions ;
using System.Diagnostics ;
using System.IO ;
Copying //UE4/Orion-Staging to //UE4/Dev-Main (Source: //Orion/Dev-General @ 2961068)
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2958488 on 2016/04/27 by Michael.Noland
Engine: Added support for UNumericProperty (int64, etc...) and doubles as allowable types in data table structures (Note: Blueprints still can't access these types, so use is limited to C++ for now)
#tests Tested with a data table created from a struct that contained int64 properties
Change 2958440 on 2016/04/27 by Leslie.Nivison
Adding .tps and licenses for elftoolchain
#test none
Change 2958434 on 2016/04/27 by david.nikdel
#ROBOMERGE-AUTHOR: josh.markiewicz
#UE4 - fix for merge conflict from 0.25 branch
#tests none
#ROBOMERGE-SOURCE: CL 2958433 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2958431 on 2016/04/27 by Martin.Wilson
Fix crash when changing curve type of new curve
#TESTS recreated original issue to prove changes fix it
Change 2958409 on 2016/04/27 by Brad.Angelcyk
updates LinuxToolChain with a function to escape arguments passed to clang
#tests compiled LinuxNoEditor and LinuxServer
Change 2958287 on 2016/04/27 by Jason.Bestimt
#ORION_DG - Merge MAIN @ CL 2958273
#RB:none
#Tests:none
Change 2958201 on 2016/04/27 by Jason.Bestimt
#ORION_DG - Merge MAIN @ CL 2958156
#RB:none
#Tests:none
Change 2958034 on 2016/04/27 by Dmitry.Rekman
Do not skip rendering commands on server (UE-29891).
- Enqueue... macros changed to make commands execute on the calling thread for UE_SERVER.
- Removed workaround in stats code that was added because advancing frame was not previously happening.
- Added logic to avoid allocating memory (and triggering check()) from NullRHI in FStaticShadowDepthMap.
#coderreview Daniel.Wright, Sam.Zamani
#tests Compiled Linux server and Windows client, ran a couple matches (on compatible cooked build).
Change 2957881 on 2016/04/27 by Andrew.Grant
Fix for UE-29973
#tests compiled
Change 2957769 on 2016/04/27 by Robert.Manuszewski
Stopping thread heartbeat when the engine crashes to prevent it from interfering with generating crash reports.
#jira OR-20501
#tests Win64 client cooked build
Change 2957711 on 2016/04/27 by david.nikdel
#ROBOMERGE-AUTHOR: ben.marsh
EC: Use the original author for any ROBOMERGED changes in failure emails.
[CodeReviewed] David.Nikdel
#ROBOMERGE-SOURCE: CL 2957709 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2957042 on 2016/04/26 by david.nikdel
#ROBOMERGE-AUTHOR: nick.atamas
Merging CL 2956472 from .25 to Main.
Fading out HUD on victory/defeat. Added code to SRetainerWidget to respect its own opacity.
#test PIE
#ROBOMERGE-SOURCE: CL 2957041 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2957005 on 2016/04/26 by Daniel.Lamb
Included pete on the rebuild lighting emails.
He will be taking over whilest I'm out next week
#test Compile.
Change 2956915 on 2016/04/26 by Leslie.Nivison
Adding .tps for swaggerui, roboto font.
#test none
Change 2956778 on 2016/04/26 by Lina.Halper
Fixed crash with curve importing UID issue
#Rb: none
#Code review:Martin.Wilson
#tests: editor, import, no crash
Change 2956735 on 2016/04/26 by Mieszko.Zielinski
Removed PRAGMA_DISABLE_OPTIMIZATION that slipped through code review #Orion
#test none
Change 2956669 on 2016/04/26 by Mieszko.Zielinski
Big Bot Objectives pass #Orion
- Objective graph navigation introduced, acompanied with BT task to take advantage of it
- lots of improvements to AICommander and ObjectiveGraph
- bot teams are aware of their human members while dealing objectives
- behavior improvements, including a separate EQS queries for melee and ranged enemy selection
Disabled for now, will get enabled in a separate CL
#test golden path
Change 2956665 on 2016/04/26 by Mieszko.Zielinski
Changed NavMesh projection code to use 2d distance when looking for the best point on navmesh #UE4
#test golen path
Change 2956639 on 2016/04/26 by Mieszko.Zielinski
Implemented a generic, template 2d grid #UE4
#test none
Change 2956628 on 2016/04/26 by Jon.Lietz
first pass on gameplay code needed for Buff Bar
- added OnTimeChangeDelegate to FActiveGameplayEffect to tracking when the duration or start effect time changes for a gameplay effect.
- added GetGameplayEffectStartTimeAndDuration() that will set the passed in start time and duration for the given FActiveGameplayEffectHandle
- added support for FOrionStatusEffectDisplayInfo to be a dynamic array vs a static one.
- added a FGameplayTag and UTexture2D* to track buff effects
#RB DaveRatti
#tests apply and remove tracked gameplay effects.
Change 2956424 on 2016/04/26 by Simon.Tovey
Fix for OR-20387
Bone Socket module could require different sizes of instance data depending on properties that can differ between lods.
Allocation code assumes all lods want the same size.
Altered module to request max of all possible sizes.
#tests Editor, GoldenPath, Fixes crash
Change 2956403 on 2016/04/26 by Mieszko.Zielinski
Generic, graph, template A* implementation #UE4
#test golden path
Change 2956360 on 2016/04/26 by Lina.Halper
Fix crash of animation editing when joint becomes invalid - due to compact joint and so on
- Coil's editing has caused issue where it isn't included to compact bone container
#tests: Michael Rumple tested this change in his local machine where we could crash consistently.
Change 2956068 on 2016/04/26 by Leslie.Nivison
Adding licenses, .tps for Mono
#test none
Change 2956049 on 2016/04/26 by Andrew.Grant
Undid accidental console variables checkin
Change 2955972 on 2016/04/26 by Bart.Bressler
Add "Mixed" replication mode used by OrionPlayerState_Game to save bandwidth while replicating the player state. Saves 1.5-2kb/s Currently turned off with a cvar (Orion.PlayerState.MixedReplicationModeForPlayers)
#tests took network profiles with/without changes, also loaded replays and used logging to make sure the correct data was getting replicated
Change 2955966 on 2016/04/26 by Andrew.Grant
Merging //UE4/Orion-Staging (Source: //UE4/Main @ 2952833)
#tests compiled, cooked, PIE, golden-path
Change 2955598 on 2016/04/25 by Andrew.Grant
Optionally show warnings and errors visually on the HUD in dev builds.
Controlled by DurationOfErrorsAndWarningsOnHUD in Engine.Engine section of DefaultEngine.ini (set to 0 to disable)
#tests game, editor, PS4 played, exited.
Change 2955589 on 2016/04/25 by Andrew.Grant
Clarified array bounds warnings in script
#tests local tests with bounds checking
Change 2955506 on 2016/04/25 by david.nikdel
#ROBOMERGE-AUTHOR: andrew.grant
Merging changes from Release branches to Main (//Orion/Main)
#ROBOMERGE-SOURCE: CL 2955505 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2955274 on 2016/04/25 by Eric.Newman
Improved support for in-memory screenshots. Added a RequestScreenshot variant that does not require a filename parameter.
#tests sent myself several player report screenshots
#robomerge: MAIN, 25
Change 2955109 on 2016/04/25 by Jason.Bestimt
#ORION_DG - Merge MAIN @ CL 2955087
#RB:none
#Tests:none
Change 2954451 on 2016/04/25 by Jason.Bestimt
#ORION_DG - Merge MAIN @ CL 2954443
#RB:none
#tests:none
Change 2954444 on 2016/04/25 by david.nikdel
#ROBOMERGE-AUTHOR: jason.bestimt
#ORION_MAIN - Merge 25 @ CL 2954417
#RB:none
#Tests:none
#ROBOMERGE-SOURCE: CL 2954443 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2954439 on 2016/04/25 by Robert.Manuszewski
Removing debug code
#tests none
Change 2954437 on 2016/04/25 by Robert.Manuszewski
Changing thread hang detection and DLL injection asserts to custom ensures so that we have time to verify if they work correctly in live environment.
- DLL injection will now print only worker threads' callstacks
- Tweaked messages printed when game hang is detected
- re-enabled DLL injection test
#tests Tested with cooked Win64 Client
Change 2954379 on 2016/04/25 by david.nikdel
#ROBOMERGE-AUTHOR: jason.bestimt
#ORION_25 - Merge 24.1 fixes @ CL 2954327
#RB:none
#Tests:none
#ROBOMERGE-SOURCE: CL 2954377 in //Orion/Release-0.25/... via CL 2954378
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2954157 on 2016/04/25 by Robert.Manuszewski
Possible fix for missing/incomplete callstacks reported by thread hartbeat when a hang is detected.
#tests Cooked Win64 client
Change 2954051 on 2016/04/24 by Chris.Gagnon
Copying CL 2953496 to Paragon from Fortnite
When the console closes it now properly restores the viewports input state (both focus and capture).
#tests ran the game and used the Console
Change 2953620 on 2016/04/22 by Brad.Angelcyk
adds nullrhi to the exclusions list for rendering on linux builds. fixes build error on case sensitive filesystems.
#tests compiled LinuxNoEditor and LinuxServer
Change 2953546 on 2016/04/22 by david.nikdel
#ROBOMERGE-AUTHOR: ben.marsh
BuildGraph: Fix chunking task not correctly filtering files into the ignore list, and adding quotes around the filenames that BPT doesn't seem parse. New output verified to be the same as UAT's debug manifest.
#tests ran chunking part of build script on an existing build, and verified that the generated ignore list matches up with the UAT debug manifest.
#ROBOMERGE-SOURCE: CL 2953545 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2953468 on 2016/04/22 by Andrew.Grant
Pulling updated PhysX binaries from //UE4/Main to address OR-19860
#tests golden path with Gideon
Change 2953432 on 2016/04/22 by Rob.Cannaday
Ignore presence updates for local user with different resources
#jira OR-19929
#tests front end party invites
#ROBOMERGE Main
Change 2953367 on 2016/04/22 by Leslie.Nivison
TPSAuditTool can't find files under Engine/Build, so adding Android .tps files under Engine/Source/ThirdParty/Android to be properly picked up.
#test none
Change 2952860 on 2016/04/22 by Ben.Marsh
EC: Simplify patterns for excluded jobs so they only have to match against the custom part of the job name. Prevents jobs with decorators such as "(#2)" not matching current patterns.
Change 2952824 on 2016/04/22 by Ben.Marsh
EC: Allow filtering out jobs from the grid view on the dashboard. We don't want to show promotion jobs there.
Change 2952632 on 2016/04/22 by Dan.Youhon
Fix delayed minion reactions to sudden root motion movements on clients
- Added OnRootMotionSourceBeingApplied virtual function to UCharacterMovementComponent, does nothing by default, in OrionCharMovementComponent we ForceServerTick() like we do on knockbacks/other velocity-changing events
- This specifically fixes Coil's BFG ability push being so quick that minions looked like they were almost teleporting to their end destination on clients - much more responsive now
#tests PIE
Change 2952390 on 2016/04/22 by david.nikdel
#ROBOMERGE-AUTHOR: andrew.grant
Back out revision 10 from //Orion/Main/Engine/Source/Runtime/PakFile/Public/IPlatformFilePak.h
#tests compiled
#ROBOMERGE-SOURCE: CL 2952388 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2952352 on 2016/04/21 by david.nikdel
#ROBOMERGE-AUTHOR: jason.bestimt
#ORION_MAIN - Merge 25 @ CL 2952347
#RB:none
#Tests:none
#ROBOMERGE-SOURCE: CL 2952351 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2952164 on 2016/04/21 by Leslie.Nivison
Removing invalid characters, incorrect redirect from .tps
#test none
Change 2952092 on 2016/04/21 by David.Ratti
Change Add to AddUnique for attribute initialization. This is to prevent adding attribute set twice in cases where people are initing attribute sets from DefaultStartingData
#tests pie
Change 2951671 on 2016/04/21 by Rob.Cannaday
Clear Recently Completed User Ids list when we flush a completion delegate.
#tests front end, parties, adding / removing friends
Change 2951511 on 2016/04/21 by Robert.Manuszewski
Added code to dump all running threads' stack traces to the log when DLL injection is detected.
#tests Tested in cooked win64 client
Change 2951384 on 2016/04/21 by Josh.Markiewicz
#UE4 - fixed assert when using a dedicated server only function in PIE
- too much of a pain to make this work properly, removing check
#tests PIE
#ROBOMERGE: MAIN, DUI
Change 2951247 on 2016/04/21 by david.nikdel
#ROBOMERGE-AUTHOR: jason.bestimt
#ORION_24.1 - Merge 24 @ CL 2951213
#RB:none
#Tests:none
#ROBOMERGE-SOURCE: CL 2951241 in //Orion/Release-0.24.1/... via CL 2951245
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2950766 on 2016/04/20 by david.nikdel
#ROBOMERGE-AUTHOR: jason.bestimt
#ORION_MAIN - Merge UI @ CL 2950642
#RB:none
#Tests:none
[CodeReviewed]: matt.kuhlenschmidt, matt.schembari
#ROBOMERGE-SOURCE: CL 2950765 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2950504 on 2016/04/20 by Jamie.Dale
Added P4FileType.Utf8
#tests Built UAT
Change 2950136 on 2016/04/20 by Andrew.Grant
Fixed issue where config var HangDuration wasn't being used
Now read from config every tick to be hotfix friendly
#tests ran game
[CL 2961397 by Andrew Grant in Main branch]
2016-04-29 15:14:04 -04:00
using System.Linq ;
2014-03-14 14:13:41 -04:00
using Microsoft.Win32 ;
2014-07-17 13:49:42 -04:00
namespace UnrealBuildTool
2014-03-14 14:13:41 -04:00
{
2015-09-24 12:37:21 -04:00
class LinuxToolChain : UEToolChain
{
2015-09-30 16:40:04 -04:00
LinuxPlatformContext PlatformContext ;
public LinuxToolChain ( LinuxPlatformContext InPlatformContext )
2015-09-27 13:05:49 -04:00
: base ( CPPTargetPlatform . Linux )
{
2015-09-30 16:40:04 -04:00
PlatformContext = InPlatformContext ;
2015-09-27 13:05:49 -04:00
if ( ! CrossCompiling ( ) )
{
// use native linux toolchain
2016-06-20 16:57:06 -04:00
string [ ] ClangNames = { "clang++" , "clang++-3.8" , "clang++-3.7" , "clang++-3.6" , "clang++-3.5" } ;
2015-09-27 13:05:49 -04:00
foreach ( var ClangName in ClangNames )
{
ClangPath = Which ( ClangName ) ;
if ( ! String . IsNullOrEmpty ( ClangPath ) )
{
break ;
}
}
GCCPath = Which ( "g++" ) ;
ArPath = Which ( "ar" ) ;
RanlibPath = Which ( "ranlib" ) ;
StripPath = Which ( "strip" ) ;
// if clang is available, zero out gcc (@todo: support runtime switching?)
if ( ! String . IsNullOrEmpty ( ClangPath ) )
{
GCCPath = null ;
}
}
else
{
// use cross linux toolchain if LINUX_ROOT is specified
BaseLinuxPath = Environment . GetEnvironmentVariable ( "LINUX_ROOT" ) ;
// don't register if we don't have an LINUX_ROOT specified
if ( String . IsNullOrEmpty ( BaseLinuxPath ) )
throw new BuildException ( "LINUX_ROOT environment variable is not set; cannot instantiate Linux toolchain" ) ;
BaseLinuxPath = BaseLinuxPath . Replace ( "\"" , "" ) ;
// set up the path to our toolchains
GCCPath = "" ;
ClangPath = Path . Combine ( BaseLinuxPath , @"bin\clang++.exe" ) ;
// ar and ranlib will be switched later to match the architecture
ArPath = "ar.exe" ;
RanlibPath = "ranlib.exe" ;
StripPath = "strip.exe" ;
}
if ( ! DetermineCompilerVersion ( ) )
{
throw new BuildException ( "Could not determine version of the compiler, not registering Linux toolchain." ) ;
}
// refuse to use compilers that we know won't work
// disable that only if you are a dev and you know what you are doing
if ( ! UsingClang ( ) )
{
throw new BuildException ( "This version of the engine can only be compiled by clang - refusing to register the Linux toolchain." ) ;
}
else if ( CompilerVersionMajor = = 3 & & CompilerVersionMinor = = 4 )
{
throw new BuildException ( "clang 3.4.x is known to miscompile the engine - refusing to register the Linux toolchain." ) ;
}
2015-12-10 16:56:55 -05:00
// prevent unknown clangs since the build is likely to fail on too old or too new compilers
2016-01-22 08:13:18 -05:00
else if ( ( CompilerVersionMajor * 10 + CompilerVersionMinor ) > 38 | | ( CompilerVersionMajor * 10 + CompilerVersionMinor ) < 35 )
2015-12-10 16:56:55 -05:00
{
throw new BuildException (
2016-06-20 16:57:06 -04:00
string . Format ( "This version of the Unreal Engine can only be compiled with clang 3.8, 3.7, 3.6 and 3.5. clang {0} may not build it - please use a different version." ,
2015-12-10 16:56:55 -05:00
CompilerVersionString )
) ;
}
2015-09-27 13:05:49 -04:00
}
2015-09-24 12:37:21 -04:00
protected static bool CrossCompiling ( )
{
return BuildHostPlatform . Current . Platform ! = UnrealTargetPlatform . Linux ;
}
2014-04-02 18:09:23 -04:00
2015-09-24 12:37:21 -04:00
protected static bool UsingClang ( )
{
return ! String . IsNullOrEmpty ( ClangPath ) ;
}
2014-05-30 10:58:16 -04:00
2015-09-24 12:37:21 -04:00
private string Which ( string name )
{
Process proc = new Process ( ) ;
proc . StartInfo . FileName = "/bin/sh" ;
proc . StartInfo . Arguments = String . Format ( "-c 'which {0}'" , name ) ;
proc . StartInfo . UseShellExecute = false ;
proc . StartInfo . CreateNoWindow = true ;
proc . StartInfo . RedirectStandardOutput = true ;
proc . StartInfo . RedirectStandardError = true ;
2014-05-08 13:01:46 -04:00
2015-09-24 12:37:21 -04:00
proc . Start ( ) ;
proc . WaitForExit ( ) ;
2014-05-08 13:01:46 -04:00
2015-09-24 12:37:21 -04:00
string path = proc . StandardOutput . ReadLine ( ) ;
Log . TraceVerbose ( String . Format ( "which {0} result: ({1}) {2}" , name , proc . ExitCode , path ) ) ;
2014-05-08 13:01:46 -04:00
2015-09-24 12:37:21 -04:00
if ( proc . ExitCode = = 0 & & String . IsNullOrEmpty ( proc . StandardError . ReadToEnd ( ) ) )
{
return path ;
}
return null ;
}
2014-05-08 13:01:46 -04:00
2015-09-24 13:47:13 -04:00
/// <summary>
/// Splits compiler version string into numerical components, leaving unchanged if not known
/// </summary>
2014-09-08 16:47:10 -04:00
private void DetermineCompilerMajMinPatchFromVersionString ( )
{
string [ ] Parts = CompilerVersionString . Split ( '.' ) ;
if ( Parts . Length > = 1 )
{
CompilerVersionMajor = Convert . ToInt32 ( Parts [ 0 ] ) ;
}
if ( Parts . Length > = 2 )
{
CompilerVersionMinor = Convert . ToInt32 ( Parts [ 1 ] ) ;
}
if ( Parts . Length > = 3 )
{
CompilerVersionPatch = Convert . ToInt32 ( Parts [ 2 ] ) ;
}
}
2015-09-24 13:47:13 -04:00
/// <summary>
/// Queries compiler for the version
/// </summary>
2014-09-08 16:47:10 -04:00
private bool DetermineCompilerVersion ( )
{
CompilerVersionString = null ;
CompilerVersionMajor = - 1 ;
CompilerVersionMinor = - 1 ;
CompilerVersionPatch = - 1 ;
Process Proc = new Process ( ) ;
Proc . StartInfo . UseShellExecute = false ;
Proc . StartInfo . CreateNoWindow = true ;
Proc . StartInfo . RedirectStandardOutput = true ;
Proc . StartInfo . RedirectStandardError = true ;
2014-09-12 17:06:44 -04:00
if ( ! String . IsNullOrEmpty ( GCCPath ) & & File . Exists ( GCCPath ) )
2014-09-08 16:47:10 -04:00
{
Proc . StartInfo . FileName = GCCPath ;
Proc . StartInfo . Arguments = " -dumpversion" ;
Proc . Start ( ) ;
Proc . WaitForExit ( ) ;
if ( Proc . ExitCode = = 0 )
{
// read just the first string
CompilerVersionString = Proc . StandardOutput . ReadLine ( ) ;
DetermineCompilerMajMinPatchFromVersionString ( ) ;
}
}
2014-09-12 17:06:44 -04:00
else if ( ! String . IsNullOrEmpty ( ClangPath ) & & File . Exists ( ClangPath ) )
2014-09-08 16:47:10 -04:00
{
Proc . StartInfo . FileName = ClangPath ;
Proc . StartInfo . Arguments = " --version" ;
Proc . Start ( ) ;
Proc . WaitForExit ( ) ;
if ( Proc . ExitCode = = 0 )
{
// read just the first string
string VersionString = Proc . StandardOutput . ReadLine ( ) ;
Regex VersionPattern = new Regex ( "version \\d+(\\.\\d+)+" ) ;
Match VersionMatch = VersionPattern . Match ( VersionString ) ;
// version match will be like "version 3.3", so remove the "version"
if ( VersionMatch . Value . StartsWith ( "version " ) )
{
CompilerVersionString = VersionMatch . Value . Replace ( "version " , "" ) ;
DetermineCompilerMajMinPatchFromVersionString ( ) ;
}
}
}
else
{
// icl?
}
2015-09-29 08:57:36 -04:00
if ( ! CrossCompiling ( ) & & ! ProjectFileGenerator . bGenerateProjectFiles )
2014-09-09 12:19:16 -04:00
{
Console . WriteLine ( "Using {0} version '{1}' (string), {2} (major), {3} (minor), {4} (patch)" ,
String . IsNullOrEmpty ( ClangPath ) ? "gcc" : "clang" ,
CompilerVersionString , CompilerVersionMajor , CompilerVersionMinor , CompilerVersionPatch ) ;
}
2014-09-08 16:47:10 -04:00
return ! String . IsNullOrEmpty ( CompilerVersionString ) ;
}
2015-09-24 13:47:13 -04:00
/// <summary>
/// Checks if compiler version matches the requirements
/// </summary>
2014-09-08 16:47:10 -04:00
private static bool CompilerVersionGreaterOrEqual ( int Major , int Minor , int Patch )
{
return CompilerVersionMajor > Major | |
( CompilerVersionMajor = = Major & & CompilerVersionMinor > Minor ) | |
( CompilerVersionMajor = = Major & & CompilerVersionMinor = = Minor & & CompilerVersionPatch > = Patch ) ;
}
2015-09-24 13:47:13 -04:00
/// <summary>
/// Architecture-specific compiler switches
/// </summary>
2014-10-30 19:44:12 -04:00
static string ArchitectureSpecificSwitches ( string Architecture )
{
string Result = "" ;
2015-09-15 19:02:34 -04:00
if ( Architecture . StartsWith ( "arm" ) )
2014-10-30 19:44:12 -04:00
{
Result + = " -fsigned-char" ;
// FreeType2's ftconfig.h will trigger this
Result + = " -Wno-deprecated-register" ;
}
return Result ;
}
static string ArchitectureSpecificDefines ( string Architecture )
{
string Result = "" ;
if ( Architecture . StartsWith ( "x86_64" ) )
{
Result + = " -D_LINUX64" ;
}
return Result ;
}
2015-09-24 13:47:13 -04:00
/// <summary>
/// Gets architecture-specific ar paths
/// </summary>
2014-10-30 19:44:12 -04:00
private static string GetArPath ( string Architecture )
{
if ( CrossCompiling ( ) )
{
return Path . Combine ( Path . Combine ( BaseLinuxPath , String . Format ( "bin/{0}-{1}" , Architecture , ArPath ) ) ) ;
}
return ArPath ;
}
2015-09-24 13:47:13 -04:00
/// <summary>
/// Gets architecture-specific ranlib paths
/// </summary>
2014-10-30 19:44:12 -04:00
private static string GetRanlibPath ( string Architecture )
{
if ( CrossCompiling ( ) )
{
return Path . Combine ( Path . Combine ( BaseLinuxPath , String . Format ( "bin/{0}-{1}" , Architecture , RanlibPath ) ) ) ;
}
return RanlibPath ;
}
2015-09-24 13:47:13 -04:00
/// <summary>
/// Gets architecture-specific strip path
/// </summary>
2015-04-27 12:53:24 -04:00
private static string GetStripPath ( string Architecture )
{
if ( CrossCompiling ( ) )
{
return Path . Combine ( Path . Combine ( BaseLinuxPath , String . Format ( "bin/{0}-{1}" , Architecture , StripPath ) ) ) ;
}
return StripPath ;
}
2014-10-30 19:44:12 -04:00
static string GetCLArguments_Global ( CPPEnvironment CompileEnvironment )
2015-09-24 12:37:21 -04:00
{
string Result = "" ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// build up the commandline common to C and C++
Result + = " -c" ;
Result + = " -pipe" ;
2014-04-02 18:09:23 -04:00
2015-09-24 12:37:21 -04:00
if ( CrossCompiling ( ) )
{
// There are exceptions used in the code base (e.g. UnrealHeadTool). @todo: weed out exceptions
// So this flag cannot be used, at least not for native Linux builds.
Result + = " -fno-exceptions" ; // no exceptions
Result + = " -DPLATFORM_EXCEPTIONS_DISABLED=1" ;
}
else
{
Result + = " -DPLATFORM_EXCEPTIONS_DISABLED=0" ;
}
2014-04-02 18:09:23 -04:00
2015-09-24 12:37:21 -04:00
Result + = " -Wall -Werror" ;
// test without this next line?
Result + = " -funwind-tables" ; // generate unwind tables as they seem to be needed for stack tracing (why??)
Result + = " -Wsequence-point" ; // additional warning not normally included in Wall: warns if order of operations is ambigious
//Result += " -Wunreachable-code"; // additional warning not normally included in Wall: warns if there is code that will never be executed - not helpful due to bIsGCC and similar
//Result += " -Wshadow"; // additional warning not normally included in Wall: warns if there variable/typedef shadows some other variable - not helpful because we have gobs of code that shadows variables
2014-10-30 19:44:12 -04:00
Result + = ArchitectureSpecificSwitches ( CompileEnvironment . Config . Target . Architecture ) ;
Result + = " -fno-math-errno" ; // do not assume that math ops have side effects
2015-09-24 12:37:21 -04:00
Result + = " -fno-rtti" ; // no run-time type info
2014-05-08 13:01:46 -04:00
2015-09-24 12:37:21 -04:00
if ( String . IsNullOrEmpty ( ClangPath ) )
{
// GCC only option
Result + = " -fno-strict-aliasing" ;
Result + = " -Wno-sign-compare" ; // needed to suppress: comparison between signed and unsigned integer expressions
Result + = " -Wno-enum-compare" ; // Stats2.h triggers this (ALIGNOF(int64) <= DATA_ALIGN)
Result + = " -Wno-return-type" ; // Variant.h triggers this
Result + = " -Wno-unused-local-typedefs" ;
Result + = " -Wno-multichar" ;
Result + = " -Wno-unused-but-set-variable" ;
Result + = " -Wno-strict-overflow" ; // Array.h:518
}
else
{
// Clang only options
2015-04-08 14:51:57 -04:00
if ( CrossCompiling ( ) )
{
Result + = " -fdiagnostics-format=msvc" ; // make diagnostics compatible with MSVC when cross-compiling
}
2015-09-24 12:37:21 -04:00
Result + = " -Wno-unused-private-field" ; // MultichannelTcpSocket.h triggers this, possibly more
// this hides the "warning : comparison of unsigned expression < 0 is always false" type warnings due to constant comparisons, which are possible with template arguments
Result + = " -Wno-tautological-compare" ;
2014-09-08 16:47:10 -04:00
// this switch is understood by clang 3.5.0, but not clang-3.5 as packaged by Ubuntu 14.04 atm
if ( CompilerVersionGreaterOrEqual ( 3 , 5 , 0 ) )
{
Result + = " -Wno-undefined-bool-conversion" ; // hides checking if 'this' pointer is null
}
2015-03-23 13:07:46 -04:00
if ( CompilerVersionGreaterOrEqual ( 3 , 6 , 0 ) )
{
Result + = " -Wno-unused-local-typedef" ; // clang is being overly strict here? PhysX headers trigger this.
2015-04-22 15:40:07 -04:00
Result + = " -Wno-inconsistent-missing-override" ; // these have to be suppressed for UE 4.8, should be fixed later.
2015-03-23 13:07:46 -04:00
}
2015-09-24 12:37:21 -04:00
}
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
Result + = " -Wno-unused-variable" ;
// this will hide the warnings about static functions in headers that aren't used in every single .cpp file
Result + = " -Wno-unused-function" ;
// this hides the "enumeration value 'XXXXX' not handled in switch [-Wswitch]" warnings - we should maybe remove this at some point and add UE_LOG(, Fatal, ) to default cases
Result + = " -Wno-switch" ;
Result + = " -Wno-unknown-pragmas" ; // Slate triggers this (with its optimize on/off pragmas)
2015-10-28 08:58:16 -04:00
// needed to suppress warnings about using offsetof on non-POD types.
Result + = " -Wno-invalid-offsetof" ;
// we use this feature to allow static FNames.
Result + = " -Wno-gnu-string-literal-operator-template" ;
2014-03-14 14:13:41 -04:00
2015-05-12 08:03:21 -04:00
if ( CompileEnvironment . Config . bEnableShadowVariableWarning )
2015-04-22 09:58:49 -04:00
{
2015-09-24 12:37:21 -04:00
Result + = " -Wshadow" + ( BuildConfiguration . bShadowVariableErrors ? "" : " -Wno-error=shadow" ) ;
2015-04-22 09:58:49 -04:00
}
2015-09-24 12:37:21 -04:00
//Result += " -DOPERATOR_NEW_INLINE=FORCENOINLINE";
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// shipping builds will cause this warning with "ensure", so disable only in those case
if ( CompileEnvironment . Config . Target . Configuration = = CPPTargetConfiguration . Shipping )
{
Result + = " -Wno-unused-value" ;
2014-05-09 22:24:58 -04:00
2014-12-15 15:29:48 -05:00
// Not stripping debug info in Shipping @FIXME: temporary hack for FN to enable callstack in Shipping builds (proper resolution: UEPLAT-205)
Result + = " -fomit-frame-pointer" ;
2015-09-24 12:37:21 -04:00
}
// switches to help debugging
else if ( CompileEnvironment . Config . Target . Configuration = = CPPTargetConfiguration . Debug )
{
Result + = " -fno-inline" ; // disable inlining for better debuggability (e.g. callstacks, "skip file" in gdb)
Result + = " -fno-omit-frame-pointer" ; // force not omitting fp
Result + = " -fstack-protector" ; // detect stack smashing
//Result += " -fsanitize=address"; // detect address based errors (support properly and link to libasan)
}
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// debug info (bCreateDebugInfo is normally set for all configurations, and we don't want it to affect Shipping performance)
if ( CompileEnvironment . Config . bCreateDebugInfo & & CompileEnvironment . Config . Target . Configuration ! = CPPTargetConfiguration . Shipping )
{
Result + = " -g3" ;
}
2014-12-15 15:29:48 -05:00
// Applying to all configurations, including Shipping @FIXME: temporary hack for FN to enable callstack in Shipping builds (proper resolution: UEPLAT-205)
else
2015-09-24 12:37:21 -04:00
{
Result + = " -gline-tables-only" ; // include debug info for meaningful callstacks
}
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// libdwarf (from elftoolchain 0.6.1) doesn't support DWARF4
Result + = " -gdwarf-3" ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// optimization level
if ( CompileEnvironment . Config . Target . Configuration = = CPPTargetConfiguration . Debug )
{
Result + = " -O0" ;
}
else
{
Result + = " -O2" ; // warning: as of now (2014-09-28), clang 3.5.0 miscompiles PlatformerGame with -O3 (bitfields?)
}
2014-04-02 18:09:23 -04:00
2015-09-24 12:37:21 -04:00
if ( CompileEnvironment . Config . bIsBuildingDLL )
{
Result + = " -fPIC" ;
// Use local-dynamic TLS model. This generates less efficient runtime code for __thread variables, but avoids problems of running into
// glibc/ld.so limit (DTV_SURPLUS) for number of dlopen()'ed DSOs with static TLS (see e.g. https://www.cygwin.com/ml/libc-help/2013-11/msg00033.html)
Result + = " -ftls-model=local-dynamic" ;
}
2015-05-22 19:57:14 -04:00
2015-09-24 12:37:21 -04:00
if ( CompileEnvironment . Config . bEnableExceptions )
{
Result + = " -fexceptions" ;
}
//Result += " -v"; // for better error diagnosis
2014-03-14 14:13:41 -04:00
2014-10-30 19:44:12 -04:00
Result + = ArchitectureSpecificDefines ( CompileEnvironment . Config . Target . Architecture ) ;
if ( CrossCompiling ( ) )
2015-09-24 12:37:21 -04:00
{
if ( UsingClang ( ) )
{
Result + = String . Format ( " -target {0}" , CompileEnvironment . Config . Target . Architecture ) ; // Set target triple
}
Result + = String . Format ( " --sysroot=\"{0}\"" , BaseLinuxPath ) ;
}
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
return Result ;
}
2014-03-14 14:13:41 -04:00
Copying //UE4/Orion-Staging to //UE4/Dev-Main (Source: //Orion/Dev-General @ 2961068)
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2958488 on 2016/04/27 by Michael.Noland
Engine: Added support for UNumericProperty (int64, etc...) and doubles as allowable types in data table structures (Note: Blueprints still can't access these types, so use is limited to C++ for now)
#tests Tested with a data table created from a struct that contained int64 properties
Change 2958440 on 2016/04/27 by Leslie.Nivison
Adding .tps and licenses for elftoolchain
#test none
Change 2958434 on 2016/04/27 by david.nikdel
#ROBOMERGE-AUTHOR: josh.markiewicz
#UE4 - fix for merge conflict from 0.25 branch
#tests none
#ROBOMERGE-SOURCE: CL 2958433 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2958431 on 2016/04/27 by Martin.Wilson
Fix crash when changing curve type of new curve
#TESTS recreated original issue to prove changes fix it
Change 2958409 on 2016/04/27 by Brad.Angelcyk
updates LinuxToolChain with a function to escape arguments passed to clang
#tests compiled LinuxNoEditor and LinuxServer
Change 2958287 on 2016/04/27 by Jason.Bestimt
#ORION_DG - Merge MAIN @ CL 2958273
#RB:none
#Tests:none
Change 2958201 on 2016/04/27 by Jason.Bestimt
#ORION_DG - Merge MAIN @ CL 2958156
#RB:none
#Tests:none
Change 2958034 on 2016/04/27 by Dmitry.Rekman
Do not skip rendering commands on server (UE-29891).
- Enqueue... macros changed to make commands execute on the calling thread for UE_SERVER.
- Removed workaround in stats code that was added because advancing frame was not previously happening.
- Added logic to avoid allocating memory (and triggering check()) from NullRHI in FStaticShadowDepthMap.
#coderreview Daniel.Wright, Sam.Zamani
#tests Compiled Linux server and Windows client, ran a couple matches (on compatible cooked build).
Change 2957881 on 2016/04/27 by Andrew.Grant
Fix for UE-29973
#tests compiled
Change 2957769 on 2016/04/27 by Robert.Manuszewski
Stopping thread heartbeat when the engine crashes to prevent it from interfering with generating crash reports.
#jira OR-20501
#tests Win64 client cooked build
Change 2957711 on 2016/04/27 by david.nikdel
#ROBOMERGE-AUTHOR: ben.marsh
EC: Use the original author for any ROBOMERGED changes in failure emails.
[CodeReviewed] David.Nikdel
#ROBOMERGE-SOURCE: CL 2957709 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2957042 on 2016/04/26 by david.nikdel
#ROBOMERGE-AUTHOR: nick.atamas
Merging CL 2956472 from .25 to Main.
Fading out HUD on victory/defeat. Added code to SRetainerWidget to respect its own opacity.
#test PIE
#ROBOMERGE-SOURCE: CL 2957041 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2957005 on 2016/04/26 by Daniel.Lamb
Included pete on the rebuild lighting emails.
He will be taking over whilest I'm out next week
#test Compile.
Change 2956915 on 2016/04/26 by Leslie.Nivison
Adding .tps for swaggerui, roboto font.
#test none
Change 2956778 on 2016/04/26 by Lina.Halper
Fixed crash with curve importing UID issue
#Rb: none
#Code review:Martin.Wilson
#tests: editor, import, no crash
Change 2956735 on 2016/04/26 by Mieszko.Zielinski
Removed PRAGMA_DISABLE_OPTIMIZATION that slipped through code review #Orion
#test none
Change 2956669 on 2016/04/26 by Mieszko.Zielinski
Big Bot Objectives pass #Orion
- Objective graph navigation introduced, acompanied with BT task to take advantage of it
- lots of improvements to AICommander and ObjectiveGraph
- bot teams are aware of their human members while dealing objectives
- behavior improvements, including a separate EQS queries for melee and ranged enemy selection
Disabled for now, will get enabled in a separate CL
#test golden path
Change 2956665 on 2016/04/26 by Mieszko.Zielinski
Changed NavMesh projection code to use 2d distance when looking for the best point on navmesh #UE4
#test golen path
Change 2956639 on 2016/04/26 by Mieszko.Zielinski
Implemented a generic, template 2d grid #UE4
#test none
Change 2956628 on 2016/04/26 by Jon.Lietz
first pass on gameplay code needed for Buff Bar
- added OnTimeChangeDelegate to FActiveGameplayEffect to tracking when the duration or start effect time changes for a gameplay effect.
- added GetGameplayEffectStartTimeAndDuration() that will set the passed in start time and duration for the given FActiveGameplayEffectHandle
- added support for FOrionStatusEffectDisplayInfo to be a dynamic array vs a static one.
- added a FGameplayTag and UTexture2D* to track buff effects
#RB DaveRatti
#tests apply and remove tracked gameplay effects.
Change 2956424 on 2016/04/26 by Simon.Tovey
Fix for OR-20387
Bone Socket module could require different sizes of instance data depending on properties that can differ between lods.
Allocation code assumes all lods want the same size.
Altered module to request max of all possible sizes.
#tests Editor, GoldenPath, Fixes crash
Change 2956403 on 2016/04/26 by Mieszko.Zielinski
Generic, graph, template A* implementation #UE4
#test golden path
Change 2956360 on 2016/04/26 by Lina.Halper
Fix crash of animation editing when joint becomes invalid - due to compact joint and so on
- Coil's editing has caused issue where it isn't included to compact bone container
#tests: Michael Rumple tested this change in his local machine where we could crash consistently.
Change 2956068 on 2016/04/26 by Leslie.Nivison
Adding licenses, .tps for Mono
#test none
Change 2956049 on 2016/04/26 by Andrew.Grant
Undid accidental console variables checkin
Change 2955972 on 2016/04/26 by Bart.Bressler
Add "Mixed" replication mode used by OrionPlayerState_Game to save bandwidth while replicating the player state. Saves 1.5-2kb/s Currently turned off with a cvar (Orion.PlayerState.MixedReplicationModeForPlayers)
#tests took network profiles with/without changes, also loaded replays and used logging to make sure the correct data was getting replicated
Change 2955966 on 2016/04/26 by Andrew.Grant
Merging //UE4/Orion-Staging (Source: //UE4/Main @ 2952833)
#tests compiled, cooked, PIE, golden-path
Change 2955598 on 2016/04/25 by Andrew.Grant
Optionally show warnings and errors visually on the HUD in dev builds.
Controlled by DurationOfErrorsAndWarningsOnHUD in Engine.Engine section of DefaultEngine.ini (set to 0 to disable)
#tests game, editor, PS4 played, exited.
Change 2955589 on 2016/04/25 by Andrew.Grant
Clarified array bounds warnings in script
#tests local tests with bounds checking
Change 2955506 on 2016/04/25 by david.nikdel
#ROBOMERGE-AUTHOR: andrew.grant
Merging changes from Release branches to Main (//Orion/Main)
#ROBOMERGE-SOURCE: CL 2955505 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2955274 on 2016/04/25 by Eric.Newman
Improved support for in-memory screenshots. Added a RequestScreenshot variant that does not require a filename parameter.
#tests sent myself several player report screenshots
#robomerge: MAIN, 25
Change 2955109 on 2016/04/25 by Jason.Bestimt
#ORION_DG - Merge MAIN @ CL 2955087
#RB:none
#Tests:none
Change 2954451 on 2016/04/25 by Jason.Bestimt
#ORION_DG - Merge MAIN @ CL 2954443
#RB:none
#tests:none
Change 2954444 on 2016/04/25 by david.nikdel
#ROBOMERGE-AUTHOR: jason.bestimt
#ORION_MAIN - Merge 25 @ CL 2954417
#RB:none
#Tests:none
#ROBOMERGE-SOURCE: CL 2954443 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2954439 on 2016/04/25 by Robert.Manuszewski
Removing debug code
#tests none
Change 2954437 on 2016/04/25 by Robert.Manuszewski
Changing thread hang detection and DLL injection asserts to custom ensures so that we have time to verify if they work correctly in live environment.
- DLL injection will now print only worker threads' callstacks
- Tweaked messages printed when game hang is detected
- re-enabled DLL injection test
#tests Tested with cooked Win64 Client
Change 2954379 on 2016/04/25 by david.nikdel
#ROBOMERGE-AUTHOR: jason.bestimt
#ORION_25 - Merge 24.1 fixes @ CL 2954327
#RB:none
#Tests:none
#ROBOMERGE-SOURCE: CL 2954377 in //Orion/Release-0.25/... via CL 2954378
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2954157 on 2016/04/25 by Robert.Manuszewski
Possible fix for missing/incomplete callstacks reported by thread hartbeat when a hang is detected.
#tests Cooked Win64 client
Change 2954051 on 2016/04/24 by Chris.Gagnon
Copying CL 2953496 to Paragon from Fortnite
When the console closes it now properly restores the viewports input state (both focus and capture).
#tests ran the game and used the Console
Change 2953620 on 2016/04/22 by Brad.Angelcyk
adds nullrhi to the exclusions list for rendering on linux builds. fixes build error on case sensitive filesystems.
#tests compiled LinuxNoEditor and LinuxServer
Change 2953546 on 2016/04/22 by david.nikdel
#ROBOMERGE-AUTHOR: ben.marsh
BuildGraph: Fix chunking task not correctly filtering files into the ignore list, and adding quotes around the filenames that BPT doesn't seem parse. New output verified to be the same as UAT's debug manifest.
#tests ran chunking part of build script on an existing build, and verified that the generated ignore list matches up with the UAT debug manifest.
#ROBOMERGE-SOURCE: CL 2953545 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2953468 on 2016/04/22 by Andrew.Grant
Pulling updated PhysX binaries from //UE4/Main to address OR-19860
#tests golden path with Gideon
Change 2953432 on 2016/04/22 by Rob.Cannaday
Ignore presence updates for local user with different resources
#jira OR-19929
#tests front end party invites
#ROBOMERGE Main
Change 2953367 on 2016/04/22 by Leslie.Nivison
TPSAuditTool can't find files under Engine/Build, so adding Android .tps files under Engine/Source/ThirdParty/Android to be properly picked up.
#test none
Change 2952860 on 2016/04/22 by Ben.Marsh
EC: Simplify patterns for excluded jobs so they only have to match against the custom part of the job name. Prevents jobs with decorators such as "(#2)" not matching current patterns.
Change 2952824 on 2016/04/22 by Ben.Marsh
EC: Allow filtering out jobs from the grid view on the dashboard. We don't want to show promotion jobs there.
Change 2952632 on 2016/04/22 by Dan.Youhon
Fix delayed minion reactions to sudden root motion movements on clients
- Added OnRootMotionSourceBeingApplied virtual function to UCharacterMovementComponent, does nothing by default, in OrionCharMovementComponent we ForceServerTick() like we do on knockbacks/other velocity-changing events
- This specifically fixes Coil's BFG ability push being so quick that minions looked like they were almost teleporting to their end destination on clients - much more responsive now
#tests PIE
Change 2952390 on 2016/04/22 by david.nikdel
#ROBOMERGE-AUTHOR: andrew.grant
Back out revision 10 from //Orion/Main/Engine/Source/Runtime/PakFile/Public/IPlatformFilePak.h
#tests compiled
#ROBOMERGE-SOURCE: CL 2952388 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2952352 on 2016/04/21 by david.nikdel
#ROBOMERGE-AUTHOR: jason.bestimt
#ORION_MAIN - Merge 25 @ CL 2952347
#RB:none
#Tests:none
#ROBOMERGE-SOURCE: CL 2952351 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2952164 on 2016/04/21 by Leslie.Nivison
Removing invalid characters, incorrect redirect from .tps
#test none
Change 2952092 on 2016/04/21 by David.Ratti
Change Add to AddUnique for attribute initialization. This is to prevent adding attribute set twice in cases where people are initing attribute sets from DefaultStartingData
#tests pie
Change 2951671 on 2016/04/21 by Rob.Cannaday
Clear Recently Completed User Ids list when we flush a completion delegate.
#tests front end, parties, adding / removing friends
Change 2951511 on 2016/04/21 by Robert.Manuszewski
Added code to dump all running threads' stack traces to the log when DLL injection is detected.
#tests Tested in cooked win64 client
Change 2951384 on 2016/04/21 by Josh.Markiewicz
#UE4 - fixed assert when using a dedicated server only function in PIE
- too much of a pain to make this work properly, removing check
#tests PIE
#ROBOMERGE: MAIN, DUI
Change 2951247 on 2016/04/21 by david.nikdel
#ROBOMERGE-AUTHOR: jason.bestimt
#ORION_24.1 - Merge 24 @ CL 2951213
#RB:none
#Tests:none
#ROBOMERGE-SOURCE: CL 2951241 in //Orion/Release-0.24.1/... via CL 2951245
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2950766 on 2016/04/20 by david.nikdel
#ROBOMERGE-AUTHOR: jason.bestimt
#ORION_MAIN - Merge UI @ CL 2950642
#RB:none
#Tests:none
[CodeReviewed]: matt.kuhlenschmidt, matt.schembari
#ROBOMERGE-SOURCE: CL 2950765 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2950504 on 2016/04/20 by Jamie.Dale
Added P4FileType.Utf8
#tests Built UAT
Change 2950136 on 2016/04/20 by Andrew.Grant
Fixed issue where config var HangDuration wasn't being used
Now read from config every tick to be hotfix friendly
#tests ran game
[CL 2961397 by Andrew Grant in Main branch]
2016-04-29 15:14:04 -04:00
/// <summary>
/// Sanitizes a definition argument if needed.
/// </summary>
/// <param name="definition">A string in the format "foo=bar".</param>
/// <returns></returns>
internal static string EscapeArgument ( string definition )
{
string [ ] splitData = definition . Split ( '=' ) ;
string myKey = splitData . ElementAtOrDefault ( 0 ) ;
string myValue = splitData . ElementAtOrDefault ( 1 ) ;
if ( string . IsNullOrEmpty ( myKey ) ) { return "" ; }
if ( ! string . IsNullOrEmpty ( myValue ) )
{
if ( ! myValue . StartsWith ( "\"" ) & & ( myValue . Contains ( " " ) | | myValue . Contains ( "$" ) ) )
{
myValue = myValue . Trim ( '\"' ) ; // trim any leading or trailing quotes
myValue = "\"" + myValue + "\"" ; // ensure wrap string with double quotes
}
// replace double quotes to escaped double quotes if exists
myValue = myValue . Replace ( "\"" , "\\\"" ) ;
}
return myValue = = null
? string . Format ( "{0}" , myKey )
: string . Format ( "{0}={1}" , myKey , myValue ) ;
}
2015-09-24 12:37:21 -04:00
static string GetCompileArguments_CPP ( )
{
string Result = "" ;
Result + = " -x c++" ;
Result + = " -std=c++11" ;
return Result ;
}
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
static string GetCompileArguments_C ( )
{
string Result = "" ;
Result + = " -x c" ;
return Result ;
}
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
static string GetCompileArguments_MM ( )
{
string Result = "" ;
Result + = " -x objective-c++" ;
Result + = " -fobjc-abi-version=2" ;
Result + = " -fobjc-legacy-dispatch" ;
Result + = " -fno-rtti" ;
Result + = " -std=c++11" ;
return Result ;
}
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
static string GetCompileArguments_M ( )
{
string Result = "" ;
Result + = " -x objective-c" ;
Result + = " -fobjc-abi-version=2" ;
Result + = " -fobjc-legacy-dispatch" ;
Result + = " -std=c++11" ;
return Result ;
}
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
static string GetCompileArguments_PCH ( )
{
string Result = "" ;
Result + = " -x c++-header" ;
Result + = " -std=c++11" ;
return Result ;
}
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
static string GetLinkArguments ( LinkEnvironment LinkEnvironment )
{
string Result = "" ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// debugging symbols
2014-12-15 15:29:48 -05:00
// Applying to all configurations @FIXME: temporary hack for FN to enable callstack in Shipping builds (proper resolution: UEPLAT-205)
2015-09-24 12:37:21 -04:00
Result + = " -rdynamic" ; // needed for backtrace_symbols()...
2014-12-15 15:29:48 -05:00
if ( LinkEnvironment . Config . bIsBuildingDLL )
2015-09-24 12:37:21 -04:00
{
Result + = " -shared" ;
}
else
{
// ignore unresolved symbols in shared libs
Result + = string . Format ( " -Wl,--unresolved-symbols=ignore-in-shared-libs" ) ;
}
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// RPATH for third party libs
Result + = " -Wl,-rpath=${ORIGIN}" ;
Result + = " -Wl,-rpath-link=${ORIGIN}" ;
Result + = " -Wl,-rpath=${ORIGIN}/../../../Engine/Binaries/Linux" ;
2014-09-30 17:04:15 -04:00
Result + = " -Wl,-rpath=${ORIGIN}/.." ; // for modules that are in sub-folders of the main Engine/Binary/Linux folder
// FIXME: really ugly temp solution. Modules need to be able to specify this
2015-09-24 12:37:21 -04:00
Result + = " -Wl,-rpath=${ORIGIN}/../../../Engine/Binaries/ThirdParty/ICU/icu4c-53_1/Linux/x86_64-unknown-linux-gnu" ;
Result + = " -Wl,-rpath=${ORIGIN}/../../../Engine/Binaries/ThirdParty/LinuxNativeDialogs/Linux/x86_64-unknown-linux-gnu" ;
2014-04-02 18:09:23 -04:00
2016-06-20 16:57:06 -04:00
// Some OS ship ld with new ELF dynamic tags, which use DT_RUNPATH vs DT_RPATH. Since DT_RUNPATH do not propagate to dlopen()ed DSOs,
// this breaks the editor on such systems. See https://kenai.com/projects/maxine/lists/users/archive/2011-01/message/12 for details
Result + = " -Wl,--disable-new-dtags" ;
2015-09-24 12:37:21 -04:00
if ( CrossCompiling ( ) )
{
if ( UsingClang ( ) )
{
Result + = String . Format ( " -target {0}" , LinkEnvironment . Config . Target . Architecture ) ; // Set target triple
}
string SysRootPath = BaseLinuxPath . TrimEnd ( new char [ ] { '\\' , '/' } ) ;
Result + = String . Format ( " \"--sysroot={0}\"" , SysRootPath ) ;
}
2014-04-02 18:09:23 -04:00
2015-09-24 12:37:21 -04:00
return Result ;
}
2014-03-14 14:13:41 -04:00
static string GetArchiveArguments ( LinkEnvironment LinkEnvironment )
{
return " rc" ;
}
2015-09-24 12:37:21 -04:00
public static void CompileOutputReceivedDataEventHandler ( Object Sender , DataReceivedEventArgs e )
{
2016-03-11 09:55:03 -05:00
Debug . Assert ( CrossCompiling ( ) ) ;
2015-09-24 12:37:21 -04:00
string Output = e . Data ;
if ( String . IsNullOrEmpty ( Output ) )
{
return ;
}
2014-03-14 14:13:41 -04:00
2016-03-11 09:55:03 -05:00
// format the string so the output errors are clickable in Visual Studio
// Need to match following for clickable links
string RegexFilePath = @"^[A-Z]\:([\\\/][A-Za-z0-9_\-\.]*)+\.(cpp|c|mm|m|hpp|h)" ;
string RegexLineNumber = @"\:\d+\:\d+\:" ;
string RegexDescription = @"(\serror:\s|\swarning:\s|\snote:\s).*" ;
// Get Matches
string MatchFilePath = Regex . Match ( Output , RegexFilePath ) . Value . Replace ( "Engine\\Source\\..\\..\\" , "" ) ;
string MatchLineNumber = Regex . Match ( Output , RegexLineNumber ) . Value ;
string MatchDescription = Regex . Match ( Output , RegexDescription ) . Value ;
// If any of the above matches failed, do nothing
if ( MatchFilePath . Length = = 0 | |
MatchLineNumber . Length = = 0 | |
MatchDescription . Length = = 0 )
2015-04-08 14:51:57 -04:00
{
2016-03-11 09:55:03 -05:00
Console . WriteLine ( Output ) ;
return ;
2015-04-08 14:51:57 -04:00
}
2016-03-11 09:55:03 -05:00
// Convert Path
string RegexStrippedPath = @"\\Engine\\.*" ; //@"(Engine\/|[A-Za-z0-9_\-\.]*\/).*";
string ConvertedFilePath = Regex . Match ( MatchFilePath , RegexStrippedPath ) . Value ;
ConvertedFilePath = Path . GetFullPath ( "..\\.." + ConvertedFilePath ) ;
// Extract Line + Column Number
string ConvertedLineNumber = Regex . Match ( MatchLineNumber , @"\d+" ) . Value ;
string ConvertedColumnNumber = Regex . Match ( MatchLineNumber , @"(?<=:\d+:)\d+" ) . Value ;
// Write output
string ConvertedExpression = " " + ConvertedFilePath + "(" + ConvertedLineNumber + "," + ConvertedColumnNumber + "):" + MatchDescription ;
Console . WriteLine ( ConvertedExpression ) ; // To create clickable vs link
2015-09-24 12:37:21 -04:00
}
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// cache the location of NDK tools
static string BaseLinuxPath ;
static string ClangPath ;
static string GCCPath ;
static string ArPath ;
static string RanlibPath ;
2015-04-27 12:53:24 -04:00
static string StripPath ;
2014-03-14 14:13:41 -04:00
2015-09-24 13:47:13 -04:00
/// <summary>
/// Version string of the current compiler, whether clang or gcc or whatever
/// </summary>
2014-09-08 16:47:10 -04:00
static string CompilerVersionString ;
2015-09-24 13:47:13 -04:00
/// <summary>
/// Major version of the current compiler, whether clang or gcc or whatever
/// </summary>
2014-09-08 16:47:10 -04:00
static int CompilerVersionMajor = - 1 ;
2015-09-24 13:47:13 -04:00
/// <summary>
/// Minor version of the current compiler, whether clang or gcc or whatever
/// </summary>
2014-09-08 16:47:10 -04:00
static int CompilerVersionMinor = - 1 ;
2015-09-24 13:47:13 -04:00
/// <summary>
/// Patch version of the current compiler, whether clang or gcc or whatever
/// </summary>
2014-09-08 16:47:10 -04:00
static int CompilerVersionPatch = - 1 ;
2015-09-24 13:47:13 -04:00
/// <summary>
/// Track which scripts need to be deleted before appending to
/// </summary>
2014-07-17 13:49:42 -04:00
private bool bHasWipedFixDepsScript = false ;
private static List < FileItem > BundleDependencies = new List < FileItem > ( ) ;
2015-09-24 12:37:21 -04:00
public override CPPOutput CompileCPPFiles ( UEBuildTarget Target , CPPEnvironment CompileEnvironment , List < FileItem > SourceFiles , string ModuleName )
{
string Arguments = GetCLArguments_Global ( CompileEnvironment ) ;
string PCHArguments = "" ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
if ( CompileEnvironment . Config . PrecompiledHeaderAction = = PrecompiledHeaderAction . Include )
{
// Add the precompiled header file's path to the include path so Clang can find it.
// This needs to be before the other include paths to ensure Clang uses it instead of the source header file.
2015-09-29 08:56:10 -04:00
var PrecompiledFileExtension = UEBuildPlatform . GetBuildPlatform ( UnrealTargetPlatform . Linux ) . GetBinaryExtension ( UEBuildBinaryType . PrecompiledHeader ) ;
2015-09-24 12:37:21 -04:00
PCHArguments + = string . Format ( " -include \"{0}\"" , CompileEnvironment . PrecompiledHeaderFile . AbsolutePath . Replace ( PrecompiledFileExtension , "" ) ) ;
}
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// Add include paths to the argument list.
foreach ( string IncludePath in CompileEnvironment . Config . CPPIncludeInfo . IncludePaths )
{
Arguments + = string . Format ( " -I\"{0}\"" , IncludePath ) ;
}
foreach ( string IncludePath in CompileEnvironment . Config . CPPIncludeInfo . SystemIncludePaths )
{
Arguments + = string . Format ( " -I\"{0}\"" , IncludePath ) ;
}
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// Add preprocessor definitions to the argument list.
foreach ( string Definition in CompileEnvironment . Config . Definitions )
{
Copying //UE4/Orion-Staging to //UE4/Dev-Main (Source: //Orion/Dev-General @ 2961068)
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2958488 on 2016/04/27 by Michael.Noland
Engine: Added support for UNumericProperty (int64, etc...) and doubles as allowable types in data table structures (Note: Blueprints still can't access these types, so use is limited to C++ for now)
#tests Tested with a data table created from a struct that contained int64 properties
Change 2958440 on 2016/04/27 by Leslie.Nivison
Adding .tps and licenses for elftoolchain
#test none
Change 2958434 on 2016/04/27 by david.nikdel
#ROBOMERGE-AUTHOR: josh.markiewicz
#UE4 - fix for merge conflict from 0.25 branch
#tests none
#ROBOMERGE-SOURCE: CL 2958433 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2958431 on 2016/04/27 by Martin.Wilson
Fix crash when changing curve type of new curve
#TESTS recreated original issue to prove changes fix it
Change 2958409 on 2016/04/27 by Brad.Angelcyk
updates LinuxToolChain with a function to escape arguments passed to clang
#tests compiled LinuxNoEditor and LinuxServer
Change 2958287 on 2016/04/27 by Jason.Bestimt
#ORION_DG - Merge MAIN @ CL 2958273
#RB:none
#Tests:none
Change 2958201 on 2016/04/27 by Jason.Bestimt
#ORION_DG - Merge MAIN @ CL 2958156
#RB:none
#Tests:none
Change 2958034 on 2016/04/27 by Dmitry.Rekman
Do not skip rendering commands on server (UE-29891).
- Enqueue... macros changed to make commands execute on the calling thread for UE_SERVER.
- Removed workaround in stats code that was added because advancing frame was not previously happening.
- Added logic to avoid allocating memory (and triggering check()) from NullRHI in FStaticShadowDepthMap.
#coderreview Daniel.Wright, Sam.Zamani
#tests Compiled Linux server and Windows client, ran a couple matches (on compatible cooked build).
Change 2957881 on 2016/04/27 by Andrew.Grant
Fix for UE-29973
#tests compiled
Change 2957769 on 2016/04/27 by Robert.Manuszewski
Stopping thread heartbeat when the engine crashes to prevent it from interfering with generating crash reports.
#jira OR-20501
#tests Win64 client cooked build
Change 2957711 on 2016/04/27 by david.nikdel
#ROBOMERGE-AUTHOR: ben.marsh
EC: Use the original author for any ROBOMERGED changes in failure emails.
[CodeReviewed] David.Nikdel
#ROBOMERGE-SOURCE: CL 2957709 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2957042 on 2016/04/26 by david.nikdel
#ROBOMERGE-AUTHOR: nick.atamas
Merging CL 2956472 from .25 to Main.
Fading out HUD on victory/defeat. Added code to SRetainerWidget to respect its own opacity.
#test PIE
#ROBOMERGE-SOURCE: CL 2957041 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2957005 on 2016/04/26 by Daniel.Lamb
Included pete on the rebuild lighting emails.
He will be taking over whilest I'm out next week
#test Compile.
Change 2956915 on 2016/04/26 by Leslie.Nivison
Adding .tps for swaggerui, roboto font.
#test none
Change 2956778 on 2016/04/26 by Lina.Halper
Fixed crash with curve importing UID issue
#Rb: none
#Code review:Martin.Wilson
#tests: editor, import, no crash
Change 2956735 on 2016/04/26 by Mieszko.Zielinski
Removed PRAGMA_DISABLE_OPTIMIZATION that slipped through code review #Orion
#test none
Change 2956669 on 2016/04/26 by Mieszko.Zielinski
Big Bot Objectives pass #Orion
- Objective graph navigation introduced, acompanied with BT task to take advantage of it
- lots of improvements to AICommander and ObjectiveGraph
- bot teams are aware of their human members while dealing objectives
- behavior improvements, including a separate EQS queries for melee and ranged enemy selection
Disabled for now, will get enabled in a separate CL
#test golden path
Change 2956665 on 2016/04/26 by Mieszko.Zielinski
Changed NavMesh projection code to use 2d distance when looking for the best point on navmesh #UE4
#test golen path
Change 2956639 on 2016/04/26 by Mieszko.Zielinski
Implemented a generic, template 2d grid #UE4
#test none
Change 2956628 on 2016/04/26 by Jon.Lietz
first pass on gameplay code needed for Buff Bar
- added OnTimeChangeDelegate to FActiveGameplayEffect to tracking when the duration or start effect time changes for a gameplay effect.
- added GetGameplayEffectStartTimeAndDuration() that will set the passed in start time and duration for the given FActiveGameplayEffectHandle
- added support for FOrionStatusEffectDisplayInfo to be a dynamic array vs a static one.
- added a FGameplayTag and UTexture2D* to track buff effects
#RB DaveRatti
#tests apply and remove tracked gameplay effects.
Change 2956424 on 2016/04/26 by Simon.Tovey
Fix for OR-20387
Bone Socket module could require different sizes of instance data depending on properties that can differ between lods.
Allocation code assumes all lods want the same size.
Altered module to request max of all possible sizes.
#tests Editor, GoldenPath, Fixes crash
Change 2956403 on 2016/04/26 by Mieszko.Zielinski
Generic, graph, template A* implementation #UE4
#test golden path
Change 2956360 on 2016/04/26 by Lina.Halper
Fix crash of animation editing when joint becomes invalid - due to compact joint and so on
- Coil's editing has caused issue where it isn't included to compact bone container
#tests: Michael Rumple tested this change in his local machine where we could crash consistently.
Change 2956068 on 2016/04/26 by Leslie.Nivison
Adding licenses, .tps for Mono
#test none
Change 2956049 on 2016/04/26 by Andrew.Grant
Undid accidental console variables checkin
Change 2955972 on 2016/04/26 by Bart.Bressler
Add "Mixed" replication mode used by OrionPlayerState_Game to save bandwidth while replicating the player state. Saves 1.5-2kb/s Currently turned off with a cvar (Orion.PlayerState.MixedReplicationModeForPlayers)
#tests took network profiles with/without changes, also loaded replays and used logging to make sure the correct data was getting replicated
Change 2955966 on 2016/04/26 by Andrew.Grant
Merging //UE4/Orion-Staging (Source: //UE4/Main @ 2952833)
#tests compiled, cooked, PIE, golden-path
Change 2955598 on 2016/04/25 by Andrew.Grant
Optionally show warnings and errors visually on the HUD in dev builds.
Controlled by DurationOfErrorsAndWarningsOnHUD in Engine.Engine section of DefaultEngine.ini (set to 0 to disable)
#tests game, editor, PS4 played, exited.
Change 2955589 on 2016/04/25 by Andrew.Grant
Clarified array bounds warnings in script
#tests local tests with bounds checking
Change 2955506 on 2016/04/25 by david.nikdel
#ROBOMERGE-AUTHOR: andrew.grant
Merging changes from Release branches to Main (//Orion/Main)
#ROBOMERGE-SOURCE: CL 2955505 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2955274 on 2016/04/25 by Eric.Newman
Improved support for in-memory screenshots. Added a RequestScreenshot variant that does not require a filename parameter.
#tests sent myself several player report screenshots
#robomerge: MAIN, 25
Change 2955109 on 2016/04/25 by Jason.Bestimt
#ORION_DG - Merge MAIN @ CL 2955087
#RB:none
#Tests:none
Change 2954451 on 2016/04/25 by Jason.Bestimt
#ORION_DG - Merge MAIN @ CL 2954443
#RB:none
#tests:none
Change 2954444 on 2016/04/25 by david.nikdel
#ROBOMERGE-AUTHOR: jason.bestimt
#ORION_MAIN - Merge 25 @ CL 2954417
#RB:none
#Tests:none
#ROBOMERGE-SOURCE: CL 2954443 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2954439 on 2016/04/25 by Robert.Manuszewski
Removing debug code
#tests none
Change 2954437 on 2016/04/25 by Robert.Manuszewski
Changing thread hang detection and DLL injection asserts to custom ensures so that we have time to verify if they work correctly in live environment.
- DLL injection will now print only worker threads' callstacks
- Tweaked messages printed when game hang is detected
- re-enabled DLL injection test
#tests Tested with cooked Win64 Client
Change 2954379 on 2016/04/25 by david.nikdel
#ROBOMERGE-AUTHOR: jason.bestimt
#ORION_25 - Merge 24.1 fixes @ CL 2954327
#RB:none
#Tests:none
#ROBOMERGE-SOURCE: CL 2954377 in //Orion/Release-0.25/... via CL 2954378
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2954157 on 2016/04/25 by Robert.Manuszewski
Possible fix for missing/incomplete callstacks reported by thread hartbeat when a hang is detected.
#tests Cooked Win64 client
Change 2954051 on 2016/04/24 by Chris.Gagnon
Copying CL 2953496 to Paragon from Fortnite
When the console closes it now properly restores the viewports input state (both focus and capture).
#tests ran the game and used the Console
Change 2953620 on 2016/04/22 by Brad.Angelcyk
adds nullrhi to the exclusions list for rendering on linux builds. fixes build error on case sensitive filesystems.
#tests compiled LinuxNoEditor and LinuxServer
Change 2953546 on 2016/04/22 by david.nikdel
#ROBOMERGE-AUTHOR: ben.marsh
BuildGraph: Fix chunking task not correctly filtering files into the ignore list, and adding quotes around the filenames that BPT doesn't seem parse. New output verified to be the same as UAT's debug manifest.
#tests ran chunking part of build script on an existing build, and verified that the generated ignore list matches up with the UAT debug manifest.
#ROBOMERGE-SOURCE: CL 2953545 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2953468 on 2016/04/22 by Andrew.Grant
Pulling updated PhysX binaries from //UE4/Main to address OR-19860
#tests golden path with Gideon
Change 2953432 on 2016/04/22 by Rob.Cannaday
Ignore presence updates for local user with different resources
#jira OR-19929
#tests front end party invites
#ROBOMERGE Main
Change 2953367 on 2016/04/22 by Leslie.Nivison
TPSAuditTool can't find files under Engine/Build, so adding Android .tps files under Engine/Source/ThirdParty/Android to be properly picked up.
#test none
Change 2952860 on 2016/04/22 by Ben.Marsh
EC: Simplify patterns for excluded jobs so they only have to match against the custom part of the job name. Prevents jobs with decorators such as "(#2)" not matching current patterns.
Change 2952824 on 2016/04/22 by Ben.Marsh
EC: Allow filtering out jobs from the grid view on the dashboard. We don't want to show promotion jobs there.
Change 2952632 on 2016/04/22 by Dan.Youhon
Fix delayed minion reactions to sudden root motion movements on clients
- Added OnRootMotionSourceBeingApplied virtual function to UCharacterMovementComponent, does nothing by default, in OrionCharMovementComponent we ForceServerTick() like we do on knockbacks/other velocity-changing events
- This specifically fixes Coil's BFG ability push being so quick that minions looked like they were almost teleporting to their end destination on clients - much more responsive now
#tests PIE
Change 2952390 on 2016/04/22 by david.nikdel
#ROBOMERGE-AUTHOR: andrew.grant
Back out revision 10 from //Orion/Main/Engine/Source/Runtime/PakFile/Public/IPlatformFilePak.h
#tests compiled
#ROBOMERGE-SOURCE: CL 2952388 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2952352 on 2016/04/21 by david.nikdel
#ROBOMERGE-AUTHOR: jason.bestimt
#ORION_MAIN - Merge 25 @ CL 2952347
#RB:none
#Tests:none
#ROBOMERGE-SOURCE: CL 2952351 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2952164 on 2016/04/21 by Leslie.Nivison
Removing invalid characters, incorrect redirect from .tps
#test none
Change 2952092 on 2016/04/21 by David.Ratti
Change Add to AddUnique for attribute initialization. This is to prevent adding attribute set twice in cases where people are initing attribute sets from DefaultStartingData
#tests pie
Change 2951671 on 2016/04/21 by Rob.Cannaday
Clear Recently Completed User Ids list when we flush a completion delegate.
#tests front end, parties, adding / removing friends
Change 2951511 on 2016/04/21 by Robert.Manuszewski
Added code to dump all running threads' stack traces to the log when DLL injection is detected.
#tests Tested in cooked win64 client
Change 2951384 on 2016/04/21 by Josh.Markiewicz
#UE4 - fixed assert when using a dedicated server only function in PIE
- too much of a pain to make this work properly, removing check
#tests PIE
#ROBOMERGE: MAIN, DUI
Change 2951247 on 2016/04/21 by david.nikdel
#ROBOMERGE-AUTHOR: jason.bestimt
#ORION_24.1 - Merge 24 @ CL 2951213
#RB:none
#Tests:none
#ROBOMERGE-SOURCE: CL 2951241 in //Orion/Release-0.24.1/... via CL 2951245
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2950766 on 2016/04/20 by david.nikdel
#ROBOMERGE-AUTHOR: jason.bestimt
#ORION_MAIN - Merge UI @ CL 2950642
#RB:none
#Tests:none
[CodeReviewed]: matt.kuhlenschmidt, matt.schembari
#ROBOMERGE-SOURCE: CL 2950765 in //Orion/Main/...
#ROBOMERGE-BOT: ORION (Main -> Dev-General)
Change 2950504 on 2016/04/20 by Jamie.Dale
Added P4FileType.Utf8
#tests Built UAT
Change 2950136 on 2016/04/20 by Andrew.Grant
Fixed issue where config var HangDuration wasn't being used
Now read from config every tick to be hotfix friendly
#tests ran game
[CL 2961397 by Andrew Grant in Main branch]
2016-04-29 15:14:04 -04:00
Arguments + = string . Format ( " -D \"{0}\"" , EscapeArgument ( Definition ) ) ;
2015-09-24 12:37:21 -04:00
}
2014-03-14 14:13:41 -04:00
2014-07-31 09:34:11 -04:00
var BuildPlatform = UEBuildPlatform . GetBuildPlatformForCPPTargetPlatform ( CompileEnvironment . Config . Target . Platform ) ;
2015-09-24 12:37:21 -04:00
// Create a compile action for each source file.
CPPOutput Result = new CPPOutput ( ) ;
foreach ( FileItem SourceFile in SourceFiles )
{
Action CompileAction = new Action ( ActionType . Compile ) ;
string FileArguments = "" ;
string Extension = Path . GetExtension ( SourceFile . AbsolutePath ) . ToUpperInvariant ( ) ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// Add C or C++ specific compiler arguments.
if ( CompileEnvironment . Config . PrecompiledHeaderAction = = PrecompiledHeaderAction . Create )
{
FileArguments + = GetCompileArguments_PCH ( ) ;
}
else if ( Extension = = ".C" )
{
// Compile the file as C code.
FileArguments + = GetCompileArguments_C ( ) ;
}
else if ( Extension = = ".CC" )
{
// Compile the file as C++ code.
FileArguments + = GetCompileArguments_CPP ( ) ;
}
else if ( Extension = = ".MM" )
{
// Compile the file as Objective-C++ code.
FileArguments + = GetCompileArguments_MM ( ) ;
}
else if ( Extension = = ".M" )
{
// Compile the file as Objective-C code.
FileArguments + = GetCompileArguments_M ( ) ;
}
else
{
FileArguments + = GetCompileArguments_CPP ( ) ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// only use PCH for .cpp files
FileArguments + = PCHArguments ;
}
2014-03-14 14:13:41 -04:00
Experimental UnrealBuildTool makefile support
UnrealBuildTool 'Makefiles' allow for very fast iterative builds.
- New BuildConfiguration.xml setting added: "bUseExperimentalFastBuildIteration" (disabled by default)
- Turning this on causes Unreal Build Tool to emit 'UBT Makefiles' for targets when they're built the first time.
- Subsequent builds will load these Makefiles and begin outdatedness checking and build invocation very quickly.
- The caveat is that if source files are added or removed to the project, UBT will need to gather information about those in order for your build to complete successfully.
- Currently, you must run the project file generator after adding/removing source files to tell UBT to re-gather this information.
- Events that can invalidate the 'UBT Makefile':
- Adding/removing .cpp files
- Adding/removing .h files with UObjects
- Adding new UObject types to a file that didn't previously have any
- Changing global build settings (most settings in this file qualify.)
- Changed code that affects how Unreal Header Tool works
- You can force regeneration of the 'UBT Makefile' by passing the '-Gather' argument, or simply regenerating project files
- New command-line parameters added:
- "-Gather": Tells UBT to always perform the gather step (slower but will catch project structural changes)
- "-NoGather": Disables the gather step, unless UBT detects that it must be done. This is the default when bUseExperimentalFastBuildIteration is enabled
- "-GatherOnly": Runs the gather step and saves a UBTMakefile, but doesn't build anything
- "-Assemble": Tells UBT to also assemble build products. This always defaults to enabled
- "-NoAssemble": Tells UBT to skip the assemble step, whether we gathered build products or not
- "-AssembleOnly": Tells UBT to only assemble build products and not to gather, unless UBT determines it must
Other changes:
- UBT now keeps track of which targets it was building in an intermediate file, to help it invalidate cached includes in subsequent runs when the targets are different
- C++ includes are now stored in a class separate from the C++ compile enviroment (for easier serialization)
- The method that UBT uses to find the CoreUObject module timestamp was rewritten
- Various '@todo ubtmake' comments added to tag possible remaining Makefile tasks
- The 'FileItem' class had some member variable comments and code cleaned up, while making it serializable
- Cleaned up the comments and member variables in the "Action" class, while making it serializable
- Some UBT classes are now "serializable". This is because we need to store the data in UBTMakefiles.
- Removed support for Actions to tinker with Stdout and Stderror (was not used for anything)
- Moved PrecompileHeaderEnvironment class to the UEBuildModule.cs source file
- Plugin intermediate include directories are now selected on demand rather than cached early
- Toolchain code for gathering prerequisite headers is now shared in a single function (AddPrerequisiteSourceFile)
- Removed Action.StatusDetailedDescription, was not used for anything
- Removed UEBuildConfiguration.bExcludePlugins, was not used for anything
- Removed ECompilationResult.FailedDueToHeaderChange, was not used for anything
[CL 2254472 by Mike Fricker in Main branch]
2014-08-13 08:17:43 -04:00
// Add the C++ source file and its included files to the prerequisite item list.
2015-09-24 12:37:21 -04:00
AddPrerequisiteSourceFile ( Target , BuildPlatform , CompileEnvironment , SourceFile , CompileAction . PrerequisiteItems ) ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
if ( CompileEnvironment . Config . PrecompiledHeaderAction = = PrecompiledHeaderAction . Create )
{
2015-09-29 08:56:10 -04:00
var PrecompiledFileExtension = UEBuildPlatform . GetBuildPlatform ( UnrealTargetPlatform . Linux ) . GetBinaryExtension ( UEBuildBinaryType . PrecompiledHeader ) ;
2015-09-24 12:37:21 -04:00
// Add the precompiled header file to the produced item list.
FileItem PrecompiledHeaderFile = FileItem . GetItemByFileReference (
FileReference . Combine (
CompileEnvironment . Config . OutputDirectory ,
Path . GetFileName ( SourceFile . AbsolutePath ) + PrecompiledFileExtension
)
) ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
CompileAction . ProducedItems . Add ( PrecompiledHeaderFile ) ;
Result . PrecompiledHeaderFile = PrecompiledHeaderFile ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// Add the parameters needed to compile the precompiled header file to the command-line.
FileArguments + = string . Format ( " -o \"{0}\"" , PrecompiledHeaderFile . AbsolutePath , false ) ;
}
else
{
if ( CompileEnvironment . Config . PrecompiledHeaderAction = = PrecompiledHeaderAction . Include )
{
CompileAction . bIsUsingPCH = true ;
CompileAction . PrerequisiteItems . Add ( CompileEnvironment . PrecompiledHeaderFile ) ;
}
2014-03-14 14:13:41 -04:00
2015-09-29 08:56:10 -04:00
var ObjectFileExtension = UEBuildPlatform . GetBuildPlatform ( UnrealTargetPlatform . Linux ) . GetBinaryExtension ( UEBuildBinaryType . Object ) ;
2015-09-24 12:37:21 -04:00
// Add the object file to the produced item list.
FileItem ObjectFile = FileItem . GetItemByFileReference (
FileReference . Combine (
CompileEnvironment . Config . OutputDirectory ,
Path . GetFileName ( SourceFile . AbsolutePath ) + ObjectFileExtension
)
) ;
CompileAction . ProducedItems . Add ( ObjectFile ) ;
Result . ObjectFiles . Add ( ObjectFile ) ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
FileArguments + = string . Format ( " -o \"{0}\"" , ObjectFile . AbsolutePath , false ) ;
}
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// Add the source file path to the command-line.
FileArguments + = string . Format ( " \"{0}\"" , SourceFile . AbsolutePath ) ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
CompileAction . WorkingDirectory = UnrealBuildTool . EngineSourceDirectory . FullName ;
if ( ! UsingClang ( ) )
{
CompileAction . CommandPath = GCCPath ;
}
else
{
CompileAction . CommandPath = ClangPath ;
}
CompileAction . CommandArguments = Arguments + FileArguments + CompileEnvironment . Config . AdditionalArguments ;
CompileAction . CommandDescription = "Compile" ;
CompileAction . StatusDescription = Path . GetFileName ( SourceFile . AbsolutePath ) ;
CompileAction . bIsGCCCompiler = true ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// Don't farm out creation of pre-compiled headers as it is the critical path task.
CompileAction . bCanExecuteRemotely =
CompileEnvironment . Config . PrecompiledHeaderAction ! = PrecompiledHeaderAction . Create | |
BuildConfiguration . bAllowRemotelyCompiledPCHs ;
2014-03-14 14:13:41 -04:00
2016-03-11 09:55:03 -05:00
// piping output through the handler during native builds is unnecessary and reportedly causes problems with tools like octobuild.
if ( CrossCompiling ( ) )
{
CompileAction . OutputEventHandler = new DataReceivedEventHandler ( CompileOutputReceivedDataEventHandler ) ;
}
2015-09-24 12:37:21 -04:00
}
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
return Result ;
}
2014-03-14 14:13:41 -04:00
2015-09-24 13:47:13 -04:00
/// <summary>
/// Creates an action to archive all the .o files into single .a file
/// </summary>
2015-09-24 12:37:21 -04:00
public FileItem CreateArchiveAndIndex ( LinkEnvironment LinkEnvironment )
{
// Create an archive action
Action ArchiveAction = new Action ( ActionType . Link ) ;
ArchiveAction . WorkingDirectory = UnrealBuildTool . EngineSourceDirectory . FullName ;
bool bUsingSh = BuildHostPlatform . Current . Platform ! = UnrealTargetPlatform . Win64 & & BuildHostPlatform . Current . Platform ! = UnrealTargetPlatform . Win32 ;
if ( bUsingSh )
{
ArchiveAction . CommandPath = "/bin/sh" ;
ArchiveAction . CommandArguments = "-c '" ;
}
else
{
ArchiveAction . CommandPath = "cmd.exe" ;
ArchiveAction . CommandArguments = "/c \"" ;
}
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// this will produce a final library
ArchiveAction . bProducesImportLibrary = true ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// Add the output file as a production of the link action.
FileItem OutputFile = FileItem . GetItemByFileReference ( LinkEnvironment . Config . OutputFilePath ) ;
ArchiveAction . ProducedItems . Add ( OutputFile ) ;
ArchiveAction . CommandDescription = "Archive" ;
ArchiveAction . StatusDescription = Path . GetFileName ( OutputFile . AbsolutePath ) ;
ArchiveAction . CommandArguments + = string . Format ( "\"{0}\" {1} \"{2}\"" , GetArPath ( LinkEnvironment . Config . Target . Architecture ) , GetArchiveArguments ( LinkEnvironment ) , OutputFile . AbsolutePath ) ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// Add the input files to a response file, and pass the response file on the command-line.
List < string > InputFileNames = new List < string > ( ) ;
foreach ( FileItem InputFile in LinkEnvironment . InputFiles )
{
string InputAbsolutePath = InputFile . AbsolutePath . Replace ( "\\" , "/" ) ;
InputFileNames . Add ( string . Format ( "\"{0}\"" , InputAbsolutePath ) ) ;
ArchiveAction . PrerequisiteItems . Add ( InputFile ) ;
ArchiveAction . CommandArguments + = string . Format ( " \"{0}\"" , InputAbsolutePath ) ;
}
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// add ranlib
ArchiveAction . CommandArguments + = string . Format ( " && \"{0}\" \"{1}\"" , GetRanlibPath ( LinkEnvironment . Config . Target . Architecture ) , OutputFile . AbsolutePath ) ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// Add the additional arguments specified by the environment.
ArchiveAction . CommandArguments + = LinkEnvironment . Config . AdditionalArguments ;
ArchiveAction . CommandArguments . Replace ( "\\" , "/" ) ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
if ( bUsingSh )
{
ArchiveAction . CommandArguments + = "'" ;
}
2015-02-27 14:38:49 -05:00
else
{
ArchiveAction . CommandArguments + = "\"" ;
}
2014-04-02 18:09:23 -04:00
2015-09-24 12:37:21 -04:00
// Only execute linking on the local PC.
ArchiveAction . bCanExecuteRemotely = false ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
return OutputFile ;
}
2014-03-14 14:13:41 -04:00
2014-07-17 13:49:42 -04:00
public FileItem FixDependencies ( LinkEnvironment LinkEnvironment , FileItem Executable )
{
if ( ! LinkEnvironment . Config . bIsCrossReferenced )
{
return null ;
}
Log . TraceVerbose ( "Adding postlink step" ) ;
2015-09-24 12:37:21 -04:00
bool bUseCmdExe = BuildHostPlatform . Current . Platform = = UnrealTargetPlatform . Win64 | | BuildHostPlatform . Current . Platform = = UnrealTargetPlatform . Win32 ;
string ShellBinary = bUseCmdExe ? "cmd.exe" : "/bin/sh" ;
string ExecuteSwitch = bUseCmdExe ? " /C" : "" ; // avoid -c so scripts don't need +x
string ScriptName = bUseCmdExe ? "FixDependencies.bat" : "FixDependencies.sh" ;
2014-07-17 13:49:42 -04:00
2015-09-24 12:37:21 -04:00
FileItem FixDepsScript = FileItem . GetItemByFileReference ( FileReference . Combine ( LinkEnvironment . Config . LocalShadowDirectory , ScriptName ) ) ;
2014-07-17 13:49:42 -04:00
Action PostLinkAction = new Action ( ActionType . Link ) ;
2015-09-03 08:47:24 -04:00
PostLinkAction . WorkingDirectory = UnrealBuildTool . EngineSourceDirectory . FullName ;
2015-09-24 12:37:21 -04:00
PostLinkAction . CommandPath = ShellBinary ;
2014-07-17 13:49:42 -04:00
PostLinkAction . StatusDescription = string . Format ( "{0}" , Path . GetFileName ( Executable . AbsolutePath ) ) ;
PostLinkAction . CommandDescription = "FixDeps" ;
PostLinkAction . bCanExecuteRemotely = false ;
2015-09-24 12:37:21 -04:00
PostLinkAction . CommandArguments = ExecuteSwitch ;
PostLinkAction . CommandArguments + = bUseCmdExe ? " \"" : " -c '" ;
2014-07-17 13:49:42 -04:00
2015-09-03 08:47:24 -04:00
FileItem OutputFile = FileItem . GetItemByFileReference ( FileReference . Combine ( LinkEnvironment . Config . LocalShadowDirectory , Path . GetFileNameWithoutExtension ( Executable . AbsolutePath ) + ".link" ) ) ;
2014-07-17 13:49:42 -04:00
// Make sure we don't run this script until the all executables and shared libraries
// have been built.
PostLinkAction . PrerequisiteItems . Add ( Executable ) ;
foreach ( FileItem Dependency in BundleDependencies )
{
PostLinkAction . PrerequisiteItems . Add ( Dependency ) ;
}
PostLinkAction . CommandArguments + = ShellBinary + ExecuteSwitch + " \"" + FixDepsScript . AbsolutePath + "\" && " ;
2015-09-24 12:37:21 -04:00
string Touch = bUseCmdExe ? "echo \"\" >> \"{0}\" && copy /b \"{0}\" +,," : "touch \"{0}\"" ;
2014-07-17 13:49:42 -04:00
2015-09-24 12:37:21 -04:00
PostLinkAction . CommandArguments + = String . Format ( Touch , OutputFile . AbsolutePath ) ;
2014-07-17 13:49:42 -04:00
PostLinkAction . CommandArguments + = bUseCmdExe ? "\"" : "'" ;
System . Console . WriteLine ( "{0} {1}" , PostLinkAction . CommandPath , PostLinkAction . CommandArguments ) ;
2015-09-24 12:37:21 -04:00
2014-07-17 13:49:42 -04:00
PostLinkAction . ProducedItems . Add ( OutputFile ) ;
return OutputFile ;
}
2015-09-24 12:37:21 -04:00
public override FileItem LinkFiles ( LinkEnvironment LinkEnvironment , bool bBuildImportLibraryOnly )
{
Debug . Assert ( ! bBuildImportLibraryOnly ) ;
2014-07-17 13:49:42 -04:00
2015-09-24 12:37:21 -04:00
List < string > RPaths = new List < string > ( ) ;
2014-07-17 13:49:42 -04:00
2015-09-24 12:37:21 -04:00
if ( LinkEnvironment . Config . bIsBuildingLibrary | | bBuildImportLibraryOnly )
{
return CreateArchiveAndIndex ( LinkEnvironment ) ;
}
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// Create an action that invokes the linker.
Action LinkAction = new Action ( ActionType . Link ) ;
LinkAction . WorkingDirectory = UnrealBuildTool . EngineSourceDirectory . FullName ;
if ( String . IsNullOrEmpty ( ClangPath ) )
{
LinkAction . CommandPath = GCCPath ;
}
else
{
LinkAction . CommandPath = ClangPath ;
}
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// Get link arguments.
LinkAction . CommandArguments = GetLinkArguments ( LinkEnvironment ) ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// Tell the action that we're building an import library here and it should conditionally be
// ignored as a prerequisite for other actions
LinkAction . bProducesImportLibrary = LinkEnvironment . Config . bIsBuildingDLL ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// Add the output file as a production of the link action.
FileItem OutputFile = FileItem . GetItemByFileReference ( LinkEnvironment . Config . OutputFilePath ) ;
LinkAction . ProducedItems . Add ( OutputFile ) ;
LinkAction . CommandDescription = "Link" ;
LinkAction . StatusDescription = Path . GetFileName ( OutputFile . AbsolutePath ) ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// Add the output file to the command-line.
LinkAction . CommandArguments + = string . Format ( " -o \"{0}\"" , OutputFile . AbsolutePath ) ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// Add the input files to a response file, and pass the response file on the command-line.
List < string > InputFileNames = new List < string > ( ) ;
foreach ( FileItem InputFile in LinkEnvironment . InputFiles )
{
InputFileNames . Add ( string . Format ( "\"{0}\"" , InputFile . AbsolutePath . Replace ( "\\" , "/" ) ) ) ;
LinkAction . PrerequisiteItems . Add ( InputFile ) ;
}
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
FileReference ResponseFileName = GetResponseFileName ( LinkEnvironment , OutputFile ) ;
LinkAction . CommandArguments + = string . Format ( " -Wl,@\"{0}\"" , ResponseFile . Create ( ResponseFileName , InputFileNames ) ) ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
if ( LinkEnvironment . Config . bIsBuildingDLL )
{
LinkAction . CommandArguments + = string . Format ( " -Wl,-soname={0}" , OutputFile ) ;
}
2014-07-17 13:49:42 -04:00
2015-09-24 12:37:21 -04:00
// Start with the configured LibraryPaths and also add paths to any libraries that
// we depend on (libraries that we've build ourselves).
List < string > AllLibraryPaths = LinkEnvironment . Config . LibraryPaths ;
foreach ( string AdditionalLibrary in LinkEnvironment . Config . AdditionalLibraries )
{
string PathToLib = Path . GetDirectoryName ( AdditionalLibrary ) ;
if ( ! String . IsNullOrEmpty ( PathToLib ) )
{
// make path absolute, because FixDependencies script may be executed in a different directory
string AbsolutePathToLib = Path . GetFullPath ( PathToLib ) ;
if ( ! AllLibraryPaths . Contains ( AbsolutePathToLib ) )
{
AllLibraryPaths . Add ( AbsolutePathToLib ) ;
}
}
2014-07-17 13:49:42 -04:00
2015-09-24 12:37:21 -04:00
if ( ( AdditionalLibrary . Contains ( "Plugins" ) | | AdditionalLibrary . Contains ( "Binaries/ThirdParty" ) | | AdditionalLibrary . Contains ( "Binaries\\ThirdParty" ) ) & & Path . GetDirectoryName ( AdditionalLibrary ) ! = Path . GetDirectoryName ( OutputFile . AbsolutePath ) )
{
string RelativePath = Utils . MakePathRelativeTo ( Path . GetDirectoryName ( AdditionalLibrary ) , Path . GetDirectoryName ( OutputFile . AbsolutePath ) ) ;
if ( ! RPaths . Contains ( RelativePath ) )
{
RPaths . Add ( RelativePath ) ;
LinkAction . CommandArguments + = string . Format ( " -Wl,-rpath=\"${{ORIGIN}}/{0}\"" , RelativePath ) ;
}
}
}
2014-07-17 13:49:42 -04:00
2015-09-24 12:37:21 -04:00
LinkAction . CommandArguments + = string . Format ( " -Wl,-rpath-link=\"{0}\"" , Path . GetDirectoryName ( OutputFile . AbsolutePath ) ) ;
2014-07-17 13:49:42 -04:00
2014-03-14 14:13:41 -04:00
// Add the library paths to the argument list.
2014-07-17 13:49:42 -04:00
foreach ( string LibraryPath in AllLibraryPaths )
2014-03-14 14:13:41 -04:00
{
2015-09-24 12:37:21 -04:00
// use absolute paths because of FixDependencies script again
2014-07-17 13:49:42 -04:00
LinkAction . CommandArguments + = string . Format ( " -L\"{0}\"" , Path . GetFullPath ( LibraryPath ) ) ;
2014-03-14 14:13:41 -04:00
}
// add libraries in a library group
2015-09-24 12:37:21 -04:00
LinkAction . CommandArguments + = string . Format ( " -Wl,--start-group" ) ;
2014-07-17 13:49:42 -04:00
2015-09-24 12:37:21 -04:00
List < string > EngineAndGameLibraries = new List < string > ( ) ;
foreach ( string AdditionalLibrary in LinkEnvironment . Config . AdditionalLibraries )
{
if ( String . IsNullOrEmpty ( Path . GetDirectoryName ( AdditionalLibrary ) ) )
{
// library was passed just like "jemalloc", turn it into -ljemalloc
LinkAction . CommandArguments + = string . Format ( " -l{0}" , AdditionalLibrary ) ;
}
else if ( Path . GetExtension ( AdditionalLibrary ) = = ".a" )
{
// static library passed in, pass it along but make path absolute, because FixDependencies script may be executed in a different directory
string AbsoluteAdditionalLibrary = Path . GetFullPath ( AdditionalLibrary ) ;
2014-10-28 20:44:29 -04:00
if ( AbsoluteAdditionalLibrary . Contains ( " " ) )
{
AbsoluteAdditionalLibrary = string . Format ( "\"{0}\"" , AbsoluteAdditionalLibrary ) ;
}
2015-09-24 12:37:21 -04:00
LinkAction . CommandArguments + = ( " " + AbsoluteAdditionalLibrary ) ;
LinkAction . PrerequisiteItems . Add ( FileItem . GetItemByPath ( AdditionalLibrary ) ) ;
}
else
{
// Skip over full-pathed library dependencies when building DLLs to avoid circular
// dependencies.
FileItem LibraryDependency = FileItem . GetItemByPath ( AdditionalLibrary ) ;
2014-07-17 13:49:42 -04:00
2015-09-24 12:37:21 -04:00
var LibName = Path . GetFileNameWithoutExtension ( AdditionalLibrary ) ;
if ( LibName . StartsWith ( "lib" ) )
{
// Remove lib prefix
LibName = LibName . Remove ( 0 , 3 ) ;
}
string LibLinkFlag = string . Format ( " -l{0}" , LibName ) ;
2014-07-17 13:49:42 -04:00
2015-09-24 12:37:21 -04:00
if ( LinkEnvironment . Config . bIsBuildingDLL & & LinkEnvironment . Config . bIsCrossReferenced )
{
// We are building a cross referenced DLL so we can't actually include
// dependencies at this point. Instead we add it to the list of
// libraries to be used in the FixDependencies step.
EngineAndGameLibraries . Add ( LibLinkFlag ) ;
if ( ! LinkAction . CommandArguments . Contains ( "--allow-shlib-undefined" ) )
{
LinkAction . CommandArguments + = string . Format ( " -Wl,--allow-shlib-undefined" ) ;
}
}
else
{
LinkAction . PrerequisiteItems . Add ( LibraryDependency ) ;
LinkAction . CommandArguments + = LibLinkFlag ;
}
}
}
LinkAction . CommandArguments + = " -lrt" ; // needed for clock_gettime()
LinkAction . CommandArguments + = " -lm" ; // math
LinkAction . CommandArguments + = string . Format ( " -Wl,--end-group" ) ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// Add the additional arguments specified by the environment.
LinkAction . CommandArguments + = LinkEnvironment . Config . AdditionalArguments ;
LinkAction . CommandArguments = LinkAction . CommandArguments . Replace ( "\\\\" , "/" ) ;
LinkAction . CommandArguments = LinkAction . CommandArguments . Replace ( "\\" , "/" ) ;
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
// prepare a linker script
FileReference LinkerScriptPath = FileReference . Combine ( LinkEnvironment . Config . LocalShadowDirectory , "remove-sym.ldscript" ) ;
if ( ! LinkEnvironment . Config . LocalShadowDirectory . Exists ( ) )
{
LinkEnvironment . Config . LocalShadowDirectory . CreateDirectory ( ) ;
}
if ( LinkerScriptPath . Exists ( ) )
{
LinkerScriptPath . Delete ( ) ;
}
2014-05-29 16:54:33 -04:00
2015-09-24 12:37:21 -04:00
using ( StreamWriter Writer = File . CreateText ( LinkerScriptPath . FullName ) )
{
Writer . WriteLine ( "UE4 {" ) ;
Writer . WriteLine ( " global: *;" ) ;
Writer . WriteLine ( " local: _Znwm;" ) ;
2015-12-10 16:56:55 -05:00
Writer . WriteLine ( " _ZnwmRKSt9nothrow_t;" ) ;
2015-09-24 12:37:21 -04:00
Writer . WriteLine ( " _Znam;" ) ;
2015-12-10 16:56:55 -05:00
Writer . WriteLine ( " _ZnamRKSt9nothrow_t;" ) ;
2015-09-24 12:37:21 -04:00
Writer . WriteLine ( " _ZdaPv;" ) ;
2015-12-10 16:56:55 -05:00
Writer . WriteLine ( " _ZdaPvRKSt9nothrow_t;" ) ;
2015-09-24 12:37:21 -04:00
Writer . WriteLine ( " _ZdlPv;" ) ;
2015-12-10 16:56:55 -05:00
Writer . WriteLine ( " _ZdlPvRKSt9nothrow_t;" ) ;
2016-06-20 16:57:06 -04:00
// Hide ALL std:: symbols as they can collide
// with any c++ library out there (like LLVM)
// and this may lead to operator new/delete mismatches
Writer . WriteLine ( " _ZNSt8*;" ) ;
2016-01-19 09:54:25 -05:00
// Hide OpenSSL symbols as they can collide with Steam runtime.
// @todo: hide all Steam runtime symbols
Writer . WriteLine ( " DH_OpenSSL;" ) ;
Writer . WriteLine ( " DSA_OpenSSL;" ) ;
Writer . WriteLine ( " DSO_METHOD_openssl;" ) ;
Writer . WriteLine ( " ECDH_OpenSSL;" ) ;
Writer . WriteLine ( " ECDSA_OpenSSL;" ) ;
Writer . WriteLine ( " OPENSSL_add_all_algorithms_noconf;" ) ;
Writer . WriteLine ( " OpenSSL_add_all_ciphers;" ) ;
Writer . WriteLine ( " OpenSSL_add_all_digests;" ) ;
Writer . WriteLine ( " OPENSSL_asc2uni;" ) ;
Writer . WriteLine ( " OPENSSL_atomic_add;" ) ;
Writer . WriteLine ( " OPENSSL_cleanse;" ) ;
Writer . WriteLine ( " OPENSSL_DIR_end;" ) ;
Writer . WriteLine ( " OPENSSL_DIR_read;" ) ;
Writer . WriteLine ( " openssl_dsa_meth;" ) ;
Writer . WriteLine ( " openssl_ecdh_meth;" ) ;
Writer . WriteLine ( " openssl_ecdsa_meth;" ) ;
Writer . WriteLine ( " OPENSSL_gmtime;" ) ;
Writer . WriteLine ( " OPENSSL_gmtime_adj;" ) ;
Writer . WriteLine ( " OPENSSL_gmtime_diff;" ) ;
Writer . WriteLine ( " OPENSSL_ia32_cpuid;" ) ;
Writer . WriteLine ( " OPENSSL_ia32_rdrand;" ) ;
Writer . WriteLine ( " OPENSSL_ia32_rdseed;" ) ;
Writer . WriteLine ( " OPENSSL_ia32cap_loc;" ) ;
Writer . WriteLine ( " OPENSSL_ia32cap_P;" ) ;
Writer . WriteLine ( " OPENSSL_init;" ) ;
Writer . WriteLine ( " OPENSSL_isservice;" ) ;
Writer . WriteLine ( " OPENSSL_issetugid;" ) ;
Writer . WriteLine ( " OPENSSL_load_builtin_modules;" ) ;
Writer . WriteLine ( " OPENSSL_NONPIC_relocated;" ) ;
Writer . WriteLine ( " OPENSSL_rdtsc;" ) ;
Writer . WriteLine ( " OPENSSL_showfatal;" ) ;
Writer . WriteLine ( " OPENSSL_stderr;" ) ;
Writer . WriteLine ( " OPENSSL_uni2asc;" ) ;
Writer . WriteLine ( " OPENSSL_wipe_cpu;" ) ;
Writer . WriteLine ( " OpenSSLDie;" ) ;
Writer . WriteLine ( " ui_openssl;" ) ;
Writer . WriteLine ( " UI_OpenSSL;" ) ;
2015-09-24 12:37:21 -04:00
Writer . WriteLine ( "};" ) ;
} ;
2014-05-29 16:54:33 -04:00
2015-09-24 12:37:21 -04:00
LinkAction . CommandArguments + = string . Format ( " -Wl,--version-script=\"{0}\"" , LinkerScriptPath ) ;
2014-05-29 16:54:33 -04:00
2015-09-24 12:37:21 -04:00
// Only execute linking on the local PC.
LinkAction . bCanExecuteRemotely = false ;
2014-03-14 14:13:41 -04:00
2014-07-17 13:49:42 -04:00
// Prepare a script that will run later, once all shared libraries and the executable
// are created. This script will be called by action created in FixDependencies()
if ( LinkEnvironment . Config . bIsCrossReferenced & & LinkEnvironment . Config . bIsBuildingDLL )
{
2015-09-24 12:37:21 -04:00
bool bUseCmdExe = BuildHostPlatform . Current . Platform = = UnrealTargetPlatform . Win64 | | BuildHostPlatform . Current . Platform = = UnrealTargetPlatform . Win32 ;
string ScriptName = bUseCmdExe ? "FixDependencies.bat" : "FixDependencies.sh" ;
2014-07-17 13:49:42 -04:00
2015-09-03 08:47:24 -04:00
string FixDepsScriptPath = Path . Combine ( LinkEnvironment . Config . LocalShadowDirectory . FullName , ScriptName ) ;
2014-07-17 13:49:42 -04:00
if ( ! bHasWipedFixDepsScript )
{
bHasWipedFixDepsScript = true ;
Log . TraceVerbose ( "Creating script: {0}" , FixDepsScriptPath ) ;
StreamWriter Writer = File . CreateText ( FixDepsScriptPath ) ;
2015-09-24 12:37:21 -04:00
if ( bUseCmdExe )
{
2014-09-16 16:32:04 -04:00
Writer . Write ( "@echo off\n" ) ;
Writer . Write ( "rem Automatically generated by UnrealBuildTool\n" ) ;
2015-09-24 12:37:21 -04:00
Writer . Write ( "rem *DO NOT EDIT*\n\n" ) ;
}
else
{
Writer . Write ( "#!/bin/sh\n" ) ;
Writer . Write ( "# Automatically generated by UnrealBuildTool\n" ) ;
Writer . Write ( "# *DO NOT EDIT*\n\n" ) ;
Writer . Write ( "set -o errexit\n" ) ;
}
Writer . Close ( ) ;
2014-07-17 13:49:42 -04:00
}
StreamWriter FixDepsScript = File . AppendText ( FixDepsScriptPath ) ;
string EngineAndGameLibrariesString = "" ;
foreach ( string Library in EngineAndGameLibraries )
{
EngineAndGameLibrariesString + = Library ;
}
FixDepsScript . Write ( string . Format ( "echo Fixing {0}\n" , Path . GetFileName ( OutputFile . AbsolutePath ) ) ) ;
2015-09-24 12:37:21 -04:00
if ( ! bUseCmdExe )
{
FixDepsScript . Write ( string . Format ( "TIMESTAMP=`stat --format %y \"{0}\"`\n" , OutputFile . AbsolutePath ) ) ;
}
2014-07-17 13:49:42 -04:00
string FixDepsLine = LinkAction . CommandPath + " " + LinkAction . CommandArguments ;
string Replace = "-Wl,--allow-shlib-undefined" ;
2015-09-24 12:37:21 -04:00
2014-07-17 13:49:42 -04:00
FixDepsLine = FixDepsLine . Replace ( Replace , EngineAndGameLibrariesString ) ;
2014-09-16 16:32:04 -04:00
string OutputFileForwardSlashes = OutputFile . AbsolutePath . Replace ( "\\" , "/" ) ;
FixDepsLine = FixDepsLine . Replace ( OutputFileForwardSlashes , OutputFileForwardSlashes + ".fixed" ) ;
2014-07-17 13:49:42 -04:00
FixDepsLine = FixDepsLine . Replace ( "$" , "\\$" ) ;
FixDepsScript . Write ( FixDepsLine + "\n" ) ;
2015-09-24 12:37:21 -04:00
if ( bUseCmdExe )
{
FixDepsScript . Write ( string . Format ( "move /Y \"{0}.fixed\" \"{0}\"\n" , OutputFile . AbsolutePath ) ) ;
}
else
{
FixDepsScript . Write ( string . Format ( "mv \"{0}.fixed\" \"{0}\"\n" , OutputFile . AbsolutePath ) ) ;
FixDepsScript . Write ( string . Format ( "touch -d \"$TIMESTAMP\" \"{0}\"\n\n" , OutputFile . AbsolutePath ) ) ;
}
2014-07-17 13:49:42 -04:00
FixDepsScript . Close ( ) ;
}
2015-09-24 12:37:21 -04:00
//LinkAction.CommandArguments += " -v";
2014-07-17 13:49:42 -04:00
2015-09-24 12:37:21 -04:00
return OutputFile ;
}
2014-03-14 14:13:41 -04:00
2015-09-24 12:37:21 -04:00
public override void CompileCSharpProject ( CSharpEnvironment CompileEnvironment , FileReference ProjectFileName , FileReference DestinationFile )
{
throw new BuildException ( "Linux cannot compile C# files" ) ;
}
2014-05-08 13:01:46 -04:00
2015-09-24 12:37:21 -04:00
public override void SetupBundleDependencies ( List < UEBuildBinary > Binaries , string GameName )
{
foreach ( UEBuildBinary Binary in Binaries )
{
BundleDependencies . Add ( FileItem . GetItemByFileReference ( Binary . Config . OutputFilePath ) ) ;
}
}
2014-07-17 13:49:42 -04:00
2015-09-24 13:47:13 -04:00
/// <summary>
/// Converts the passed in path from UBT host to compiler native format.
/// </summary>
2015-09-24 12:37:21 -04:00
public override string ConvertPath ( string OriginalPath )
{
if ( BuildHostPlatform . Current . Platform = = UnrealTargetPlatform . Linux )
{
return OriginalPath . Replace ( "\\" , "/" ) ;
}
else
{
return OriginalPath ;
}
}
2014-07-17 13:49:42 -04:00
2015-09-24 12:37:21 -04:00
public override ICollection < FileItem > PostBuild ( FileItem Executable , LinkEnvironment BinaryLinkEnvironment )
{
var OutputFiles = base . PostBuild ( Executable , BinaryLinkEnvironment ) ;
2014-07-17 13:49:42 -04:00
2015-09-24 12:37:21 -04:00
if ( BinaryLinkEnvironment . Config . bIsBuildingDLL | | BinaryLinkEnvironment . Config . bIsBuildingLibrary )
{
return OutputFiles ;
}
2014-07-17 13:49:42 -04:00
2015-09-24 12:37:21 -04:00
FileItem FixDepsOutputFile = FixDependencies ( BinaryLinkEnvironment , Executable ) ;
if ( FixDepsOutputFile ! = null )
{
OutputFiles . Add ( FixDepsOutputFile ) ;
}
2014-07-17 13:49:42 -04:00
2015-09-24 12:37:21 -04:00
return OutputFiles ;
}
2014-12-02 14:58:59 -05:00
2015-04-27 12:53:24 -04:00
public override void StripSymbols ( string SourceFileName , string TargetFileName )
{
File . Copy ( SourceFileName , TargetFileName , true ) ;
ProcessStartInfo StartInfo = new ProcessStartInfo ( ) ;
2015-09-30 16:40:04 -04:00
StartInfo . FileName = GetStripPath ( PlatformContext . GetActiveArchitecture ( ) ) ;
2015-06-16 10:42:46 -04:00
StartInfo . Arguments = "--strip-debug \"" + TargetFileName + "\"" ;
2015-04-27 12:53:24 -04:00
StartInfo . UseShellExecute = false ;
StartInfo . CreateNoWindow = true ;
Utils . RunLocalProcessAndLogOutput ( StartInfo ) ;
}
2014-12-02 14:58:59 -05:00
}
2014-03-14 14:13:41 -04:00
}