Files
UnrealEngineUWP/Engine/Source/Programs/UnrealBuildTool/Linux/LinuxToolChain.cs
Ryan Vance 8044633af9 Copying //UE4/Dev-VR to //UE4/Dev-Main (Source: //UE4/Dev-VR @ 3383750)
#lockdown Nick.Penwarden

==========================
MAJOR FEATURES + CHANGES
==========================

Change 3012064 on 2016/06/13 by Nick.Whiting

	Merging Main -> DevVR

Change 3048060 on 2016/07/13 by Nick.Whiting

	Integrating CL 3045721 from //depot/Partners/Google/AndroidVR-DevVR
	Upgrade Android and iOS GVR SDK to the latest.
	Fix the flipped vignette issue when using Unreal's post processing distortion.
	Change the Daydream & Cardboard mode to use scanline racing.
	Deprecate the ability to turn off individual UI elements.

Change 3235307 on 2016/12/14 by Keli.Hlodversson

	Filter out excluded HMD modules during FEngineLoop:PreInitHMDDevice. The final selection still happens in UEngine::InitializeHMDDevice as all HMD plugins have not been loaded during PreInit

Change 3235308 on 2016/12/14 by Ryan.Vance

	#jira UEVR-478

	Monoscopic far field improvements

	Shader changes are now gated behind the read only cvar vr.MonoscopicFarField. Changing this requires a shader compile.
	Moved the mono rendering mode to the cvar vr.MonoscopicFarFieldMode. This is writable, so users can enable/disable mono rendering on the fly if the above cvar is enabled.
	Only write to the alpha channel in the mobile base pass if the object is opaque and MONOSCOPIC_FAR_FIELD is defined.
	Addressed code review comments.

Change 3235397 on 2016/12/14 by Keli.Hlodversson

	[Oculus] Only enable GearVR platform on Windows if Oculus service is running
	Original author: Loren.McQuade

Change 3235762 on 2016/12/14 by Keli.Hlodversson

	Add explicit parentheses to placate the build bots.

Change 3242318 on 2016/12/21 by Ryan.Vance

	Working around pixel density crash.

Change 3242522 on 2016/12/21 by Ryan.Vance

	Missing flag clear so our adaptive test was always returning true.

Change 3243173 on 2016/12/22 by Ryan.Vance

	Integrating post present callback implementation from 4.14.1

Change 3248633 on 2017/01/05 by Keli.Hlodversson

	Copying //Tasks/UE4/Dev-VR-Refactoring to Dev-VR-Minimal (//UE4/Dev-VR-Minimal)

Change 3248723 on 2017/01/05 by Keli.Hlodversson

	Fix after merge. EnablePositionalTracking no longer exists.

Change 3249484 on 2017/01/06 by Keli.Hlodversson

	Add missing includes

Change 3249714 on 2017/01/06 by Keli.Hlodversson

	Remove monolithic header include

Change 3249980 on 2017/01/06 by Keli.Hlodversson

	SteamVR: Remove leftover unused WindowMirrorMode member variable

Change 3252432 on 2017/01/10 by Keli.Hlodversson

	Submitting change by Loren McQuade to fix monolithic builds.

	Unshelved from pending changelist '3251436':

Change 3257373 on 2017/01/13 by Keli.Hlodversson

	#jira UEVR-411: Finish renaming/removing/remodelling the remaining Oculus (Rift+GearVR) commands
	#jira UEVR-412: Rename and merge remaining Morpheus console commands
	#jira UEVR-417: Remove Exec from IHeadMountedDisplay

Change 3269971 on 2017/01/24 by Jeff.Fisher

	UEVR-498 move controller is missing world to meters
	UEVR-522 PS4 motion controller worldscale support.
	-Passing world to meters scale into getControllerOrientationAndPosition because the thing asking about it ought to be part of a world, and know what it should be.  This also avoids making PS4 motion controllers dependent on the HMD.  Note Google VR Controller doesn't do position, so doesnt' care about scale.  Oculus already had internal threadsafe tracking of world scale, so I left that.  Steam handles world scale below our input level.
	-Also adding PlayerIndex member to FSceneView so we can figure out which view the MotionControllerComponent should get its worldscale from for the late render thread update.
	#jira UEVR-498
	#review-3384107

Change 3288308 on 2017/02/06 by Jeff.Fisher

	UEVR-517 Detect MotionController Connectivity
	-PS4 can only track 2 controllers and 1 hmd.  Support for dealing with that is needed.
	-Also need to support multiple motion controller components mapped to a single controller.  Licencees have done that before.
	-Created a new interface IMotionTrackingSystemManagement, and implements it for PS4Tracker on PS4.
	-Created a MotionTrackedDeviceFunctionLibrary to expose that interface to blueprint.
	-With those one can enable and disable tracking on ps4 controllers and query their state to stay within the controller tracking limit.
	-PS4Tracker also keeps a blackboard of the enable/disable state so that one can enable or disable controllers that have not been connected yet, and have them enable tracking or not when they are connected.
	-DS4 controller no longer jumps back to 000 if it loses tracking.
	#review-3384107
	#jira UEVR-517

Change 3288309 on 2017/02/06 by Keli.Hlodversson

	Add file missing from CL#3257373.

Change 3288311 on 2017/02/06 by Jeff.Fisher

	UEVR-517 Detect MotionController Connectivity - Test content.
	-tm-motionControllers has a third mode where all playstation motion controllers for player 0 are availalbe.  You can toggle them to track or not with ctrl-P,G,L,R for pad, gun, leftmove, rightmove or with alt-P,G,L,R.  Ctrl tests doing so via MotionControllerComponent.  Alt tests doing so by player index and controller type enum.
	-ctrl-A disables tracking of all controllers
	-alt-A disables tracking of all controllers for player 0
	-ctrl-D toggles enabling new controllers by default
	-Also fixed one button not working in one of the other test modes for the Aim (gun) controller.
	-The controller 'models' have an arrow out the front.  It is black if disabled.  Red if enabled, but no tracker is active, yellow if tracked but inertial only, and green if fully tracked by the camera.
	-This logic is in the QA_MoCoAll blueprint.

Change 3291601 on 2017/02/07 by Jeff.Fisher

	UEVR-536 PSVR motion controller tracking problem with multiple controllers
	-Previous code called GetRelativeTransform from the render thread, but the game thread could update it at any time.  This caches that transform so that it can be safely used in the render thread.
	#jira UEVR-536
	#review-3384107 @Ryan.Vance

Change 3292460 on 2017/02/08 by Jeff.Fisher

	PS4 sceVrTrackerGetResult() error warning logging improved, and explanatory comment added.

Change 3308771 on 2017/02/17 by Keli.Hlodversson

	Rename GoogleVR console commands
	#jira UEVR-412

Change 3309156 on 2017/02/17 by Keli.Hlodversson

	Track changes in r.ScreenPercentage on GoogleVR and set RenderTargetSize accordingly.

Change 3311999 on 2017/02/20 by Keli.Hlodversson

	Create a default implementation for RecordAnalytics.

	Also create an initial stub for FHeadMountedDisplayBase for future default implementations of common HMD functionality.
	Make implementing IHeadMountedDisplay::GetDeviceName mandatory instead of defaulting to "Unknown"
	#jira UE-21878
	#jira UEVR-213

Change 3313467 on 2017/02/20 by Ryan.Vance

	#jira UE-41604

	3278583
	pCustomPresent->AllocateRenderTargetTexture may return false, if we blindly return true we can end up with an invalid render target since the fall back sceneviewport will be skipped.

	3278536
	Adding ovrError_NoHmd to our sanity check in OnStartGameFrame.

Change 3314002 on 2017/02/21 by Keli.Hlodversson

	Fix compilation on PS4 and Linux

Change 3326722 on 2017/03/01 by Jeff.Fisher

	Merging //UE4/Dev-Main to Dev-VR (//UE4/Dev-VR)
	Integrating 4.15 from main.

Change 3327567 on 2017/03/01 by Jeff.Fisher

	UEVR-588 Oculus crash on "stereo on" when the proximity sensor is not triggered.
	Duplicating from Release-4.15 cl 3327481, 3327542
	-Don't ovr_SubmitFrame when the layers need to be recreated.  They stay dirty until rendering is unpaused.
	#jira UEVR-588

	#review-3384107

Change 3328098 on 2017/03/01 by Jeff.Fisher

	4.15 merge fixes
	-Fixed deprecated enum name function usage.
	-Fixed world scale usage in GoogleVRController.
	-Fixed compile break in PS4Tracker.

Change 3328271 on 2017/03/01 by Jeff.Fisher

	2.15 merge
	-restroging GoogleVRController::GetWorldToMetersScale... cause it is used everywhere.

Change 3328307 on 2017/03/01 by Jeff.Fisher

	4.15 merge
	-More googlevr worldscale fixes.

Change 3328312 on 2017/03/01 by Jeff.Fisher

	4.15 merge
	-removing 2 unused includes

Change 3330610 on 2017/03/02 by Jeff.Fisher

	4.15 merge
	-fixing linux build

Change 3333952 on 2017/03/06 by Keli.Hlodversson

	Implement common stereo layer management base class and use it in SteamVR and PS4. Fixes an outstanding bug in SteamVR where texures are updated every frame regardles of whether the continous update flag is set or not.

	#jira UEVR-628
	#jira UE-42555

Change 3334961 on 2017/03/07 by Keli.Hlodversson

	Add missing include to fix non-unity builds

Change 3336200 on 2017/03/07 by Keli.Hlodversson

	Fix compilation issues. (https://ec-01.epicgames.net/commander/link/jobDetails/jobs/7568252?jobName=UE4+Dev-VR+-+CL+3334961+-+Nightly+Build&s=Jobs)
	* Pre VS2015 compilers don't like mixing wide and unmarked strings in concatenation. Unfortunately LOCTEXT hides the call to the TEXT macro, completely hinding the prefix (which only gets added to the first fragment.)
	* Switch apparently doesn't know how to format a size_t for analytics either.
	Also: Typo in backwards compatibility command name alias

Change 3337347 on 2017/03/08 by Jeff.Fisher

	UE-42631 Stereo off while prox sensor uncovered causes low framerate
	-Setting maxfps appropriately on 'stereo on/off'.
	#review-3384107
	#jira UE-42631

Change 3338385 on 2017/03/08 by Ryan.Vance

	r.DisableDistortion was only being used for the mobile renderer

Change 3342301 on 2017/03/10 by patrickr.donovan

	Test updates to TM-VRSmoke.
	Increased lightmap resolution on QA_MeshTypes meshes to improve readbility and reliablility of tests involving said asset.
	Rebuilt lighting.

Change 3348133 on 2017/03/15 by Ryan.Vance

	Moving mono cvars to scene rendering to avoid cross module references. There's not a good reason to have them in the hmd module anyway.

Change 3348836 on 2017/03/15 by Ryan.Vance

	Direct multi-view support for gear vr
	Monoscopic far field with multi-view (blit and direct) support for gear vr
	Support for translucent objects on both sides of the mono clip plane (due to a sorting issue, objects that straddle the plane composite incorrectly)
	Fixed missing discards/clears in the multi-view blit

Change 3348843 on 2017/03/15 by Ryan.Vance

	Fixing color/depth target size mismatch when screen percentage scaling results in a size that isn't divisible by 16.

Change 3349276 on 2017/03/16 by Keli.Hlodversson

	Fixing compile errors in GoogleVR after merge from main.

Change 3350932 on 2017/03/16 by Ryan.Vance

	Re-enabling the gearvr plugin on windows.

Change 3351977 on 2017/03/17 by Jeff.Fisher

	Fixing masked member variable.

Change 3352314 on 2017/03/17 by Ryan.Vance

	We need to ensure that we don't select different lod levels for each eye.

Change 3352993 on 2017/03/17 by Nick.Whiting

	Integrating CL 3345824 from Android-DevVR to Dev-VR.  Support for device depth pass in SceneCaptureComponent2D

Change 3355185 on 2017/03/20 by Nick.Whiting

	Added ability to disable the autoloading splash screen, which would prevent the hide splash screen node from ever working

Change 3355676 on 2017/03/20 by Nick.Whiting

	PR #3384: [GNUX] SteamVR, OpenGL patch. (Contributed by yaakuro), with some minor modifications

Change 3357286 on 2017/03/21 by Jeff.Fisher

	Fixing GenerateProjectFiles, looks like the .config. was removed from these references in main some time ago.

Change 3357435 on 2017/03/21 by Jeff.Fisher

	Fixing editor build break, looks like a merge mistake.

Change 3359960 on 2017/03/23 by Keli.Hlodversson

	Prevent potential crash when drawing tracking sensor location. Also only fetch HMD location once instead of once per tracking sensor.

Change 3361230 on 2017/03/23 by Jeff.Fisher

	Fixing linux build opengl include problem... maybe.

Change 3361638 on 2017/03/23 by Jeff.Fisher

	Another guess at fixing linux build.

Change 3364224 on 2017/03/24 by Keli.Hlodversson

	Initial implementation of UEVR-576 - Base emulated layer implementation

	#jira UEVR-668 - Base emulated layer implementation: Initial framework for overrideable default implementation
	#jira UEVR-669 - Base emulated layer implementation: Face Locked Layers Support
	#jira UEVR-670 - Base emulated layer implementation: Tracker Locked Layers Support
	#jira UEVR-671 - Base emulated layer implementation: World Locked Layers Support
	#jira UEVR-672 - Base emulated layer implementation: Add support for optionally rendering face locked layers into a separate layer

Change 3364242 on 2017/03/24 by Keli.Hlodversson

	SteamVR layers do not support negatve Layer priorities

Change 3364263 on 2017/03/24 by Jeff.Fisher

	Merging //UE4/Dev-Main to Dev-VR (//UE4/Dev-VR)
	Monoscopicfarfieldrendering was just 'accept source', Ryan is going to look at fixing it up.

Change 3364472 on 2017/03/24 by Jeff.Fisher

	Merge fix

Change 3364475 on 2017/03/24 by Jeff.Fisher

	Fixing gearvr include.

Change 3364486 on 2017/03/24 by Jeff.Fisher

	merge fix

Change 3364532 on 2017/03/24 by Ryan.Vance

	pso update for mono rendering and stereo layers.

Change 3364599 on 2017/03/24 by Ryan.Vance

	Oculus changes for SI1.12

Change 3365159 on 2017/03/26 by Jeff.Fisher

	include fix

Change 3365182 on 2017/03/26 by Jeff.Fisher

	include fix

Change 3366087 on 2017/03/27 by Ryan.Vance

	Remaining files from Oculus changes for SI1.12 merge request.
	Fixing a bug in OnlineSubsystem.
	Temporarily changing the eye padding change to be a shader clear to work around a clear color binding issue.

Change 3366492 on 2017/03/27 by Ryan.Vance

	#jira UE-43294
	Moved the clear before we setup state for drawing the mirror window content. It was stomping over state after the pso changes.
	Going to leave the shader clear in the rift prerender for clearing the eye padding for now.

Change 3366929 on 2017/03/27 by Ryan.Vance

	Fixing compile error

Change 3368549 on 2017/03/28 by Jeff.Fisher

	Merging Change: 3357998 from //UE4/Partner-Google-VR/Engine/... to Dev-VR
	Upgrade Google VR Plugin to v1.3:
	*Upgraded GVR NDK to 1.30.0
	*Changed some BlueprintFunction to use BlueprintPure
	*Add the missing bDaydream flag in UEDeployAndroid.cs
	#review-3384107

Change 3368975 on 2017/03/28 by Ryan.Vance

	CIS clean up
	#jira UE-43428, UE-43429, UE-43426, UE-43427

Change 3369028 on 2017/03/28 by Ryan.Vance

	This is not exacly 'correct', but it's at least what the code was trying to do.

Change 3370203 on 2017/03/29 by Ryan.Vance

	Adding gear vr controller component support.

Change 3370918 on 2017/03/29 by Ryan.Vance

	Merging 3370569 using Partner-Google-VR_to_DevVR

Change 3371030 on 2017/03/29 by Ryan.Vance

	Fixing linux build errors

	#jira UE-43426

Change 3371036 on 2017/03/29 by Ryan.Vance

	Oculus 4.16 integration.
	Not terribly happy with the use of std::string. They promised to clean this up for the next release.

Change 3373495 on 2017/03/30 by Jeff.Fisher

	Merging from Dev-Main, in preparation for 4.16

Change 3373578 on 2017/03/30 by Jeff.Fisher

	build break, one comma short

Change 3373870 on 2017/03/31 by Jeff.Fisher

	Include order fix.

Change 3374001 on 2017/03/31 by Keli.Hlodversson

	Use DefaultStereoLayers as base for Morpheus implementation.
	#jira UEVR-709 #jira UE-42919
	#rb: Jeff.Fisher

Change 3374004 on 2017/03/31 by Keli.Hlodversson

	Fix rendering for the default Stereo Layers implementation on mobile.
	Depth test was set to "Never" instead of "Always"
	Destination texture on GLES is flipped on the Y axis, the coordinates are reversed in the shade when compiled on the relevant platforms.

Change 3375125 on 2017/03/31 by Jeff.Fisher

	UE-43506 Ensure using VRPreview with GoogleVR
	-Removed the ensure, there is code in there to handle that case, and it works.
	#jira UE-43506

Change 3375294 on 2017/03/31 by nick.bullard

	Resaving Plugin content to resovle "saved with empty engine version"

	#jira UE-43537

Change 3375480 on 2017/03/31 by Jeff.Fisher

	UEVR-9 PSVR: Social Screen Support
	-Experimental social screen support for 4.16.
	-This does the basics of driving output through the Aux port in the proper format for display on the mirror monitor.
	-Only supports 30fps on the mirror monitor.  60fps will require the implementation of sony system dialogs to deal with incompatable system features (video streaming, remote play).
	-There is a project setting in Morpheus, under experiemental bEnableSocialScreenSeparateMode.  This must be set to true to use this feature.  When it is false we avoid allocating the back buffers.
	-MorpheusFunctionLibrary blueprints now have a node "SetSocialScreenMode" which can switch between SystemMirror (hardware supported mirroring), SeparateTest (alternates black and white), SeparateTexture (displays a texture, eg a render target, specified via blueprint), and SeparateMirror(puts the hmd render buffer on screen - which is both eyes, like a debug mode).
	-Also finally updated the bEnabled flag in project settings to tell people it's only for PC.
	#jira UEVR-9
	#review-3384107

Change 3375540 on 2017/03/31 by Ryan.Vance

	#jira UE-43504

	Fixing android build break when using a 64 bit isa.

Change 3375655 on 2017/03/31 by Jeff.Fisher

	Fixing missing RGBAToYUV shader problem
	-This at least unblocks our process.  Will revisit before zbr.

Change 3375820 on 2017/04/01 by Jeff.Fisher

	Fixing linux build warning about HAS_MORPHEUS

Change 3376050 on 2017/04/02 by Jeff.Fisher

	 UE-43515 Step 'UE4Editor Static Analysis Win64' - Module.OnlineSubsystemOculus.cpp Warnings
	-Temporary fix for static analysis annotation warnings in OnlineSubsytemOculus. Longer term plan is to eliminate the use of the headers that trigger the warnings.
	-Just wrap all standard headers in static analysis disables.

	#jira UE-43515

Change 3376609 on 2017/04/03 by Jeff.Fisher

	Fixing rgbatoyuvshader include.

Change 3377001 on 2017/04/03 by Jeff.Fisher

	UE-43547 Launch On PS4 fails during Run command - Missing global shader FRGBAToYUV420CS
	- shader c++ must be compiled so that it can be cooked for ps4.

	#jira UE-43547

Change 3379858 on 2017/04/04 by Jeff.Fisher

	Merging //UE4/Dev-Main to Dev-VR (//UE4/Dev-VR)
	pulling main this should get us ps4 sdk 4.508

Change 3379938 on 2017/04/04 by Ryan.Vance

	#jira UE-43548

	If stereo layers are not being used, don't setup overlay targets as we will never clear/initialize them.
	The clear happens as part of the default layers PostRenderView_RenderThread call which wont be called if layers aren't being used in the scene.

Change 3381519 on 2017/04/05 by Jeff.Fisher

	UEVR-733 PS4 sdk 4.500 hmd connection api changes break hmd connect.
	-Handling failure of sceHmdGetDeviceInformation if the hmd is powered off.  It now returns an error code about an invalid handle in that case, rather than reporting unready.  We just treat the error code like an unready status.
	#jira UEVR-733
	#review-3384107

Change 3382019 on 2017/04/05 by Ryan.Vance

	Linux: add Vulkan support from dev editor: 3381593

Change 3382021 on 2017/04/05 by Ryan.Vance

	SteamVR on Linux using Vulkan
	OpenVR rev to 1_0_6

	PR #3412: [GNUX] Initial support for SteamVR using Vulkan on GNUX platform. (Contributed by yaakuro)

Change 3382076 on 2017/04/05 by Ryan.Vance

	Fixing linux steamvr lib path. It changed to something less silly in 1.0.6
	Removing the steamvr plugin from the white list for linux. It's looking for a runtime that no one will have installed.

Change 3383237 on 2017/04/06 by Ryan.Vance

	#jira UE-43732
	Fixing Android compile issues. We can't wrap portions of a macro with a definie. This should probably be some sort of recursive macro thing since there's so much overlap. Good enough for now.

Change 3383353 on 2017/04/06 by Ryan.Vance

	Fixing include cycles.

Change 3383509 on 2017/04/06 by Jeff.Fisher

	Merging //UE4/Dev-Main to Dev-VR (//UE4/Dev-VR)
	merging the stuff from dev-mobile

[CL 3384106 by Ryan Vance in Main branch]
2017-04-06 22:03:51 -04:00

1372 lines
50 KiB
C#

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Diagnostics;
using System.IO;
using System.Linq;
using Microsoft.Win32;
namespace UnrealBuildTool
{
class LinuxToolChain : UEToolChain
{
string Architecture;
public LinuxToolChain(string InArchitecture)
: base(CppPlatform.Linux)
{
Architecture = InArchitecture;
if (!CrossCompiling())
{
// use native linux toolchain
string[] ClangNames = { "clang++", "clang++-3.9", "clang++-3.8", "clang++-3.7", "clang++-3.6", "clang++-3.5" };
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
{
// if new multi-arch toolchain is used, prefer it
string MultiArchRoot = Environment.GetEnvironmentVariable("LINUX_MULTIARCH_ROOT");
if (MultiArchRoot != null)
{
// FIXME: UBT should loop across all the architectures and compile for all the selected ones.
BaseLinuxPath = Path.Combine(MultiArchRoot, Architecture);
Console.WriteLine("Using LINUX_MULTIARCH_ROOT, building with toolchain '{0}'", BaseLinuxPath);
}
else
{
// use cross linux toolchain if LINUX_ROOT is specified
BaseLinuxPath = Environment.GetEnvironmentVariable("LINUX_ROOT");
Console.WriteLine("Using LINUX_ROOT (deprecated, consider LINUX_MULTIARCH_ROOT), building with toolchain '{0}'", BaseLinuxPath);
}
// 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.");
}
// prevent unknown clangs since the build is likely to fail on too old or too new compilers
else if ((CompilerVersionMajor * 10 + CompilerVersionMinor) > 40 || (CompilerVersionMajor * 10 + CompilerVersionMinor) < 35)
{
throw new BuildException(
string.Format("This version of the Unreal Engine can only be compiled with clang 4.0, 3.9, 3.8, 3.7, 3.6 and 3.5. clang {0} may not build it - please use a different version.",
CompilerVersionString)
);
}
}
protected static bool CrossCompiling()
{
return BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Linux;
}
protected static bool UsingClang()
{
return !String.IsNullOrEmpty(ClangPath);
}
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;
proc.Start();
proc.WaitForExit();
string path = proc.StandardOutput.ReadLine();
Log.TraceVerbose(String.Format("which {0} result: ({1}) {2}", name, proc.ExitCode, path));
if (proc.ExitCode == 0 && String.IsNullOrEmpty(proc.StandardError.ReadToEnd()))
{
return path;
}
return null;
}
/// <summary>
/// Splits compiler version string into numerical components, leaving unchanged if not known
/// </summary>
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]);
}
}
/// <summary>
/// Queries compiler for the version
/// </summary>
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;
if (!String.IsNullOrEmpty(GCCPath) && File.Exists(GCCPath))
{
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();
}
}
else if (!String.IsNullOrEmpty(ClangPath) && File.Exists(ClangPath))
{
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?
}
if (!CrossCompiling() && !ProjectFileGenerator.bGenerateProjectFiles)
{
Console.WriteLine("Using {0} version '{1}' (string), {2} (major), {3} (minor), {4} (patch)",
String.IsNullOrEmpty(ClangPath) ? "gcc" : "clang",
CompilerVersionString, CompilerVersionMajor, CompilerVersionMinor, CompilerVersionPatch);
}
return !String.IsNullOrEmpty(CompilerVersionString);
}
/// <summary>
/// Checks if compiler version matches the requirements
/// </summary>
private static bool CompilerVersionGreaterOrEqual(int Major, int Minor, int Patch)
{
return CompilerVersionMajor > Major ||
(CompilerVersionMajor == Major && CompilerVersionMinor > Minor) ||
(CompilerVersionMajor == Major && CompilerVersionMinor == Minor && CompilerVersionPatch >= Patch);
}
/// <summary>
/// Architecture-specific compiler switches
/// </summary>
static string ArchitectureSpecificSwitches(string Architecture)
{
string Result = "";
if (Architecture.StartsWith("arm") || Architecture.StartsWith("aarch64"))
{
Result += " -fsigned-char";
}
return Result;
}
static string ArchitectureSpecificDefines(string Architecture)
{
string Result = "";
if (Architecture.StartsWith("x86_64") || Architecture.StartsWith("aarch64"))
{
Result += " -D_LINUX64";
}
return Result;
}
/// <summary>
/// Gets architecture-specific ar paths
/// </summary>
private static string GetArPath(string Architecture)
{
if (CrossCompiling())
{
return Path.Combine(Path.Combine(BaseLinuxPath, String.Format("bin/{0}-{1}", Architecture, ArPath)));
}
return ArPath;
}
/// <summary>
/// Gets architecture-specific ranlib paths
/// </summary>
private static string GetRanlibPath(string Architecture)
{
if (CrossCompiling())
{
return Path.Combine(Path.Combine(BaseLinuxPath, String.Format("bin/{0}-{1}", Architecture, RanlibPath)));
}
return RanlibPath;
}
/// <summary>
/// Gets architecture-specific strip path
/// </summary>
private static string GetStripPath(string Architecture)
{
if (CrossCompiling())
{
return Path.Combine(Path.Combine(BaseLinuxPath, String.Format("bin/{0}-{1}", Architecture, StripPath)));
}
return StripPath;
}
private static bool ShouldUseLibcxx(string Architecture)
{
// set UE4_LINUX_USE_LIBCXX to either 0 or 1. If unset, defaults to 1.
string UseLibcxxEnvVarOverride = Environment.GetEnvironmentVariable("UE4_LINUX_USE_LIBCXX");
if (UseLibcxxEnvVarOverride != null && (UseLibcxxEnvVarOverride == "1"))
{
return true;
}
// at the moment ARM32 libc++ remains missing
return Architecture.StartsWith("x86_64") || Architecture.StartsWith("aarch64") || Architecture.StartsWith("i686");
}
static string GetCLArguments_Global(CppCompileEnvironment CompileEnvironment)
{
string Result = "";
// build up the commandline common to C and C++
Result += " -c";
Result += " -pipe";
if (ShouldUseLibcxx(CompileEnvironment.Architecture))
{
Result += " -nostdinc++";
Result += " -I" + "ThirdParty/Linux/LibCxx/include/";
Result += " -I" + "ThirdParty/Linux/LibCxx/include/c++/v1";
}
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
Result += ArchitectureSpecificSwitches(CompileEnvironment.Architecture);
Result += " -fno-math-errno"; // do not assume that math ops have side effects
Result += GetRTTIFlag(CompileEnvironment); // flag for run-time type info
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
if (CrossCompiling())
{
Result += " -fdiagnostics-format=msvc"; // make diagnostics compatible with MSVC when cross-compiling
}
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";
// 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
}
if (CompilerVersionGreaterOrEqual(3, 6, 0))
{
Result += " -Wno-unused-local-typedef"; // clang is being overly strict here? PhysX headers trigger this.
Result += " -Wno-inconsistent-missing-override"; // these have to be suppressed for UE 4.8, should be fixed later.
}
if (CompilerVersionGreaterOrEqual(3, 9, 0))
{
Result += " -Wno-undefined-var-template"; // not really a good warning to disable
}
}
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)
// 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";
if (CompileEnvironment.bEnableShadowVariableWarnings)
{
Result += " -Wshadow" + (CompileEnvironment.bShadowVariableWarningsAsErrors ? "" : " -Wno-error=shadow");
}
if (CompileEnvironment.bEnableUndefinedIdentifierWarnings)
{
Result += " -Wundef" + (CompileEnvironment.bUndefinedIdentifierWarningsAsErrors ? "" : " -Wno-error=undef");
}
//Result += " -DOPERATOR_NEW_INLINE=FORCENOINLINE";
// shipping builds will cause this warning with "ensure", so disable only in those case
if (CompileEnvironment.Configuration == CppConfiguration.Shipping)
{
Result += " -Wno-unused-value";
Result += " -fomit-frame-pointer";
}
// switches to help debugging
else if (CompileEnvironment.Configuration == CppConfiguration.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)
}
// debug info
// bCreateDebugInfo is normally set for all configurations, including Shipping - this is needed to enable callstack in Shipping builds (proper resolution: UEPLAT-205, separate files with debug info)
if (CompileEnvironment.bCreateDebugInfo)
{
// libdwarf (from elftoolchain 0.6.1) doesn't support DWARF4
Result += " -gdwarf-3";
}
// optimization level
if (!CompileEnvironment.bOptimizeCode)
{
Result += " -O0";
}
else
{
Result += " -O2"; // warning: as of now (2014-09-28), clang 3.5.0 miscompiles PlatformerGame with -O3 (bitfields?)
}
if (CompileEnvironment.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";
}
if (CompileEnvironment.bEnableExceptions)
{
Result += " -fexceptions";
Result += " -DPLATFORM_EXCEPTIONS_DISABLED=0";
}
else
{
Result += " -fno-exceptions"; // no exceptions
Result += " -DPLATFORM_EXCEPTIONS_DISABLED=1";
}
//Result += " -v"; // for better error diagnosis
Result += ArchitectureSpecificDefines(CompileEnvironment.Architecture);
if (CrossCompiling())
{
if (UsingClang())
{
Result += String.Format(" -target {0}", CompileEnvironment.Architecture); // Set target triple
}
Result += String.Format(" --sysroot=\"{0}\"", BaseLinuxPath);
}
return Result;
}
/// <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);
}
static string GetCompileArguments_CPP()
{
string Result = "";
Result += " -x c++";
Result += " -std=c++14";
return Result;
}
static string GetCompileArguments_C()
{
string Result = "";
Result += " -x c";
return Result;
}
static string GetCompileArguments_MM()
{
string Result = "";
Result += " -x objective-c++";
Result += " -fobjc-abi-version=2";
Result += " -fobjc-legacy-dispatch";
Result += " -std=c++14";
return Result;
}
// Conditionally enable (default disabled) generation of information about every class with virtual functions for use by the C++ runtime type identification features
// (`dynamic_cast' and `typeid'). If you don't use those parts of the language, you can save some space by using -fno-rtti.
// Note that exception handling uses the same information, but it will generate it as needed.
static string GetRTTIFlag(CppCompileEnvironment CompileEnvironment)
{
string Result = "";
if (CompileEnvironment.bUseRTTI)
{
Result = " -frtti";
}
else
{
Result = " -fno-rtti";
}
return Result;
}
static string GetCompileArguments_M()
{
string Result = "";
Result += " -x objective-c";
Result += " -fobjc-abi-version=2";
Result += " -fobjc-legacy-dispatch";
Result += " -std=c++14";
return Result;
}
static string GetCompileArguments_PCH()
{
string Result = "";
Result += " -x c++-header";
Result += " -std=c++14";
return Result;
}
string GetLinkArguments(LinkEnvironment LinkEnvironment)
{
string Result = "";
// debugging symbols
// Applying to all configurations @FIXME: temporary hack for FN to enable callstack in Shipping builds (proper resolution: UEPLAT-205)
Result += " -rdynamic"; // needed for backtrace_symbols()...
if (LinkEnvironment.bIsBuildingDLL)
{
Result += " -shared";
}
else
{
// ignore unresolved symbols in shared libs
Result += string.Format(" -Wl,--unresolved-symbols=ignore-in-shared-libs");
}
// RPATH for third party libs
Result += " -Wl,-rpath=${ORIGIN}";
Result += " -Wl,-rpath-link=${ORIGIN}";
Result += " -Wl,-rpath=${ORIGIN}/../../../Engine/Binaries/Linux";
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
Result += " -Wl,-rpath=${ORIGIN}/../../../Engine/Binaries/ThirdParty/Steamworks/Steamv139/x86_64-unknown-linux-gnu";
if (LinkEnvironment.Architecture.StartsWith("x86_64"))
{
Result += " -Wl,-rpath=${ORIGIN}/../../../Engine/Binaries/ThirdParty/Qualcomm/Linux";
}
else
{
// x86_64 is now using updated ICU that doesn't need extra .so
Result += " -Wl,-rpath=${ORIGIN}/../../../Engine/Binaries/ThirdParty/ICU/icu4c-53_1/Linux/" + LinkEnvironment.Architecture;
}
Result += " -Wl,-rpath=${ORIGIN}/../../../Engine/Binaries/ThirdParty/OpenAL/Linux/" + LinkEnvironment.Architecture;
Result += " -Wl,-rpath=${ORIGIN}/../../../Engine/Binaries/ThirdParty/CEF3/Linux";
Result += " -Wl,-rpath=${ORIGIN}/../../../Engine/Binaries/ThirdParty/OpenVR/OpenVRv1_0_2/Linux/" + LinkEnvironment.Architecture;
// 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";
// This severely improves dynamic linker performance, but affects iteration times. Do not do it in Debug,
// because taking a hit of several tens of seconds on startup is better than linking for ~4 more minutes when iterating
if (LinkEnvironment.Configuration != CppConfiguration.Debug)
{
Result += " -Wl,--as-needed";
}
// Additionally speeds up editor startup by 1-2s
Result += " -Wl,--hash-style=gnu";
if (CrossCompiling())
{
if (UsingClang())
{
Result += String.Format(" -target {0}", LinkEnvironment.Architecture); // Set target triple
}
string SysRootPath = BaseLinuxPath.TrimEnd(new char[] { '\\', '/' });
Result += String.Format(" \"--sysroot={0}\"", SysRootPath);
}
return Result;
}
static string GetArchiveArguments(LinkEnvironment LinkEnvironment)
{
return " rc";
}
public static void CrossCompileOutputReceivedDataEventHandler(Object Sender, DataReceivedEventArgs e)
{
Debug.Assert(CrossCompiling());
string Output = e.Data;
if (String.IsNullOrEmpty(Output))
{
return;
}
// 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)
{
Console.WriteLine(Output);
return;
}
// 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
}
// cache the location of NDK tools
static string BaseLinuxPath;
static string ClangPath;
static string GCCPath;
static string ArPath;
static string RanlibPath;
static string StripPath;
/// <summary>
/// Version string of the current compiler, whether clang or gcc or whatever
/// </summary>
static string CompilerVersionString;
/// <summary>
/// Major version of the current compiler, whether clang or gcc or whatever
/// </summary>
static int CompilerVersionMajor = -1;
/// <summary>
/// Minor version of the current compiler, whether clang or gcc or whatever
/// </summary>
static int CompilerVersionMinor = -1;
/// <summary>
/// Patch version of the current compiler, whether clang or gcc or whatever
/// </summary>
static int CompilerVersionPatch = -1;
/// <summary>
/// Track which scripts need to be deleted before appending to
/// </summary>
private bool bHasWipedFixDepsScript = false;
/// <summary>
/// Tracks that information about used C++ library is only printed once
/// </summary>
private bool bHasPrintedLibcxxInformation = false;
private static List<FileItem> BundleDependencies = new List<FileItem>();
public override CPPOutput CompileCPPFiles(CppCompileEnvironment CompileEnvironment, List<FileItem> SourceFiles, string ModuleName, ActionGraph ActionGraph)
{
string Arguments = GetCLArguments_Global(CompileEnvironment);
string PCHArguments = "";
if (!bHasPrintedLibcxxInformation)
{
// inform the user which C++ library the engine is going to be compiled against - important for compatibility with third party code that uses STL
bool bUseLibCxx = ShouldUseLibcxx(CompileEnvironment.Architecture);
Console.WriteLine("Using {0} standard C++ library.", bUseLibCxx ? "bundled libc++" : "compiler default (most likely libstdc++)");
bHasPrintedLibcxxInformation = true;
}
if (CompileEnvironment.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.
var PrecompiledFileExtension = UEBuildPlatform.GetBuildPlatform(UnrealTargetPlatform.Linux).GetBinaryExtension(UEBuildBinaryType.PrecompiledHeader);
PCHArguments += string.Format(" -include \"{0}\"", CompileEnvironment.PrecompiledHeaderFile.AbsolutePath.Replace(PrecompiledFileExtension, ""));
}
foreach(FileReference ForceIncludeFile in CompileEnvironment.ForceIncludeFiles)
{
PCHArguments += String.Format(" -include \"{0}\"", ForceIncludeFile.FullName);
}
// Add include paths to the argument list.
foreach (string IncludePath in CompileEnvironment.IncludePaths.UserIncludePaths)
{
Arguments += string.Format(" -I\"{0}\"", IncludePath);
}
foreach (string IncludePath in CompileEnvironment.IncludePaths.SystemIncludePaths)
{
Arguments += string.Format(" -I\"{0}\"", IncludePath);
}
// Add preprocessor definitions to the argument list.
foreach (string Definition in CompileEnvironment.Definitions)
{
Arguments += string.Format(" -D \"{0}\"", EscapeArgument(Definition));
}
// Create a compile action for each source file.
CPPOutput Result = new CPPOutput();
foreach (FileItem SourceFile in SourceFiles)
{
Action CompileAction = ActionGraph.Add(ActionType.Compile);
string FileArguments = "";
string Extension = Path.GetExtension(SourceFile.AbsolutePath).ToUpperInvariant();
// Add C or C++ specific compiler arguments.
if (CompileEnvironment.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();
FileArguments += GetRTTIFlag(CompileEnvironment);
}
else if (Extension == ".M")
{
// Compile the file as Objective-C code.
FileArguments += GetCompileArguments_M();
}
else
{
FileArguments += GetCompileArguments_CPP();
// only use PCH for .cpp files
FileArguments += PCHArguments;
}
// Add the C++ source file and its included files to the prerequisite item list.
AddPrerequisiteSourceFile(CompileEnvironment, SourceFile, CompileAction.PrerequisiteItems);
if (CompileEnvironment.PrecompiledHeaderAction == PrecompiledHeaderAction.Create)
{
var PrecompiledFileExtension = UEBuildPlatform.GetBuildPlatform(UnrealTargetPlatform.Linux).GetBinaryExtension(UEBuildBinaryType.PrecompiledHeader);
// Add the precompiled header file to the produced item list.
FileItem PrecompiledHeaderFile = FileItem.GetItemByFileReference(
FileReference.Combine(
CompileEnvironment.OutputDirectory,
Path.GetFileName(SourceFile.AbsolutePath) + PrecompiledFileExtension
)
);
CompileAction.ProducedItems.Add(PrecompiledHeaderFile);
Result.PrecompiledHeaderFile = PrecompiledHeaderFile;
// Add the parameters needed to compile the precompiled header file to the command-line.
FileArguments += string.Format(" -o \"{0}\"", PrecompiledHeaderFile.AbsolutePath);
}
else
{
if (CompileEnvironment.PrecompiledHeaderAction == PrecompiledHeaderAction.Include)
{
CompileAction.bIsUsingPCH = true;
CompileAction.PrerequisiteItems.Add(CompileEnvironment.PrecompiledHeaderFile);
}
var ObjectFileExtension = UEBuildPlatform.GetBuildPlatform(UnrealTargetPlatform.Linux).GetBinaryExtension(UEBuildBinaryType.Object);
// Add the object file to the produced item list.
FileItem ObjectFile = FileItem.GetItemByFileReference(
FileReference.Combine(
CompileEnvironment.OutputDirectory,
Path.GetFileName(SourceFile.AbsolutePath) + ObjectFileExtension
)
);
CompileAction.ProducedItems.Add(ObjectFile);
Result.ObjectFiles.Add(ObjectFile);
FileArguments += string.Format(" -o \"{0}\"", ObjectFile.AbsolutePath);
}
// Add the source file path to the command-line.
FileArguments += string.Format(" \"{0}\"", SourceFile.AbsolutePath);
CompileAction.WorkingDirectory = UnrealBuildTool.EngineSourceDirectory.FullName;
if (!UsingClang())
{
CompileAction.CommandPath = GCCPath;
}
else
{
CompileAction.CommandPath = ClangPath;
}
CompileAction.CommandArguments = Arguments + FileArguments + CompileEnvironment.AdditionalArguments;
CompileAction.CommandDescription = "Compile";
CompileAction.StatusDescription = Path.GetFileName(SourceFile.AbsolutePath);
CompileAction.bIsGCCCompiler = true;
// Don't farm out creation of pre-compiled headers as it is the critical path task.
CompileAction.bCanExecuteRemotely =
CompileEnvironment.PrecompiledHeaderAction != PrecompiledHeaderAction.Create ||
CompileEnvironment.bAllowRemotelyCompiledPCHs;
// piping output through the handler during native builds is unnecessary and reportedly causes problems with tools like octobuild.
if (CrossCompiling())
{
CompileAction.OutputEventHandler = new DataReceivedEventHandler(CrossCompileOutputReceivedDataEventHandler);
}
}
return Result;
}
/// <summary>
/// Creates an action to archive all the .o files into single .a file
/// </summary>
public FileItem CreateArchiveAndIndex(LinkEnvironment LinkEnvironment, ActionGraph ActionGraph)
{
// Create an archive action
Action ArchiveAction = ActionGraph.Add(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 \"";
}
// this will produce a final library
ArchiveAction.bProducesImportLibrary = true;
// Add the output file as a production of the link action.
FileItem OutputFile = FileItem.GetItemByFileReference(LinkEnvironment.OutputFilePath);
ArchiveAction.ProducedItems.Add(OutputFile);
ArchiveAction.CommandDescription = "Archive";
ArchiveAction.StatusDescription = Path.GetFileName(OutputFile.AbsolutePath);
ArchiveAction.CommandArguments += string.Format("\"{0}\" {1} \"{2}\"", GetArPath(LinkEnvironment.Architecture), GetArchiveArguments(LinkEnvironment), OutputFile.AbsolutePath);
// 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);
}
// this won't stomp linker's response (which is not used when compiling static libraries)
FileReference ResponsePath = GetResponseFileName(LinkEnvironment, OutputFile);
if (!ProjectFileGenerator.bGenerateProjectFiles)
{
ResponseFile.Create(ResponsePath, InputFileNames);
}
ArchiveAction.CommandArguments += string.Format(" @\"{0}\"", ConvertPath(ResponsePath.FullName));
// add ranlib
ArchiveAction.CommandArguments += string.Format(" && \"{0}\" \"{1}\"", GetRanlibPath(LinkEnvironment.Architecture), OutputFile.AbsolutePath);
// Add the additional arguments specified by the environment.
ArchiveAction.CommandArguments += LinkEnvironment.AdditionalArguments;
ArchiveAction.CommandArguments = ArchiveAction.CommandArguments.Replace("\\", "/");
if (bUsingSh)
{
ArchiveAction.CommandArguments += "'";
}
else
{
ArchiveAction.CommandArguments += "\"";
}
// Only execute linking on the local PC.
ArchiveAction.bCanExecuteRemotely = false;
// piping output through the handler during native builds is unnecessary and reportedly causes problems with tools like octobuild.
if (CrossCompiling())
{
ArchiveAction.OutputEventHandler = new DataReceivedEventHandler(CrossCompileOutputReceivedDataEventHandler);
}
return OutputFile;
}
public FileItem FixDependencies(LinkEnvironment LinkEnvironment, FileItem Executable, ActionGraph ActionGraph)
{
if (!LinkEnvironment.bIsCrossReferenced)
{
return null;
}
Log.TraceVerbose("Adding postlink step");
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";
FileItem FixDepsScript = FileItem.GetItemByFileReference(FileReference.Combine(LinkEnvironment.LocalShadowDirectory, ScriptName));
Action PostLinkAction = ActionGraph.Add(ActionType.Link);
PostLinkAction.WorkingDirectory = UnrealBuildTool.EngineSourceDirectory.FullName;
PostLinkAction.CommandPath = ShellBinary;
PostLinkAction.StatusDescription = string.Format("{0}", Path.GetFileName(Executable.AbsolutePath));
PostLinkAction.CommandDescription = "FixDeps";
PostLinkAction.bCanExecuteRemotely = false;
PostLinkAction.CommandArguments = ExecuteSwitch;
PostLinkAction.CommandArguments += bUseCmdExe ? " \"" : " -c '";
FileItem OutputFile = FileItem.GetItemByFileReference(FileReference.Combine(LinkEnvironment.LocalShadowDirectory, Path.GetFileNameWithoutExtension(Executable.AbsolutePath) + ".link"));
// 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 + "\" && ";
// output file should not be empty or it will be rebuilt next time
string Touch = bUseCmdExe ? "echo \"Dummy\" >> \"{0}\" && copy /b \"{0}\" +,," : "echo \"Dummy\" >> \"{0}\"";
PostLinkAction.CommandArguments += String.Format(Touch, OutputFile.AbsolutePath);
PostLinkAction.CommandArguments += bUseCmdExe ? "\"" : "'";
System.Console.WriteLine("{0} {1}", PostLinkAction.CommandPath, PostLinkAction.CommandArguments);
// piping output through the handler during native builds is unnecessary and reportedly causes problems with tools like octobuild.
if (CrossCompiling())
{
PostLinkAction.OutputEventHandler = new DataReceivedEventHandler(CrossCompileOutputReceivedDataEventHandler);
}
PostLinkAction.ProducedItems.Add(OutputFile);
return OutputFile;
}
public override FileItem LinkFiles(LinkEnvironment LinkEnvironment, bool bBuildImportLibraryOnly, ActionGraph ActionGraph)
{
Debug.Assert(!bBuildImportLibraryOnly);
List<string> RPaths = new List<string>();
if (LinkEnvironment.bIsBuildingLibrary || bBuildImportLibraryOnly)
{
return CreateArchiveAndIndex(LinkEnvironment, ActionGraph);
}
// Create an action that invokes the linker.
Action LinkAction = ActionGraph.Add(ActionType.Link);
LinkAction.WorkingDirectory = UnrealBuildTool.EngineSourceDirectory.FullName;
if (String.IsNullOrEmpty(ClangPath))
{
LinkAction.CommandPath = GCCPath;
}
else
{
LinkAction.CommandPath = ClangPath;
}
// Get link arguments.
LinkAction.CommandArguments = GetLinkArguments(LinkEnvironment);
// 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.bIsBuildingDLL;
// Add the output file as a production of the link action.
FileItem OutputFile = FileItem.GetItemByFileReference(LinkEnvironment.OutputFilePath);
LinkAction.ProducedItems.Add(OutputFile);
LinkAction.CommandDescription = "Link";
LinkAction.StatusDescription = Path.GetFileName(OutputFile.AbsolutePath);
// Add the output file to the command-line.
LinkAction.CommandArguments += string.Format(" -o \"{0}\"", OutputFile.AbsolutePath);
// 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);
}
FileReference ResponseFileName = GetResponseFileName(LinkEnvironment, OutputFile);
LinkAction.CommandArguments += string.Format(" -Wl,@\"{0}\"", ResponseFile.Create(ResponseFileName, InputFileNames));
if (LinkEnvironment.bIsBuildingDLL)
{
LinkAction.CommandArguments += string.Format(" -Wl,-soname={0}", OutputFile);
}
// 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.LibraryPaths;
foreach (string AdditionalLibrary in LinkEnvironment.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);
}
}
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);
}
}
}
LinkAction.CommandArguments += string.Format(" -Wl,-rpath-link=\"{0}\"", Path.GetDirectoryName(OutputFile.AbsolutePath));
// Add the library paths to the argument list.
foreach (string LibraryPath in AllLibraryPaths)
{
// use absolute paths because of FixDependencies script again
LinkAction.CommandArguments += string.Format(" -L\"{0}\"", Path.GetFullPath(LibraryPath));
}
List<string> EngineAndGameLibraries = new List<string>();
// Pre-2.25 ld has symbol resolution problems when .so are mixed with .a in a single --start-group/--end-group
// when linking with --as-needed.
// Move external libraries to a separate --start-group/--end-group to fix it (and also make groups smaller and faster to link).
// See https://github.com/EpicGames/UnrealEngine/pull/2778 and https://github.com/EpicGames/UnrealEngine/pull/2793 for discussion
string ExternalLibraries = "";
// add libraries in a library group
LinkAction.CommandArguments += string.Format(" -Wl,--start-group");
foreach (string AdditionalLibrary in LinkEnvironment.AdditionalLibraries)
{
if (String.IsNullOrEmpty(Path.GetDirectoryName(AdditionalLibrary)))
{
// library was passed just like "jemalloc", turn it into -ljemalloc
ExternalLibraries += 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);
if (AbsoluteAdditionalLibrary.Contains(" "))
{
AbsoluteAdditionalLibrary = string.Format("\"{0}\"", AbsoluteAdditionalLibrary);
}
// libcrypto/libssl contain number of functions that are being used in different DSOs. FIXME: generalize?
if (LinkEnvironment.bIsBuildingDLL && (AbsoluteAdditionalLibrary.Contains("libcrypto") || AbsoluteAdditionalLibrary.Contains("libssl")))
{
LinkAction.CommandArguments += (" -Wl,--whole-archive " + AbsoluteAdditionalLibrary + " -Wl,--no-whole-archive");
}
else
{
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);
var LibName = Path.GetFileNameWithoutExtension(AdditionalLibrary);
if (LibName.StartsWith("lib"))
{
// Remove lib prefix
LibName = LibName.Remove(0, 3);
}
string LibLinkFlag = string.Format(" -l{0}", LibName);
if (LinkEnvironment.bIsBuildingDLL && LinkEnvironment.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);
ExternalLibraries += LibLinkFlag;
}
}
}
LinkAction.CommandArguments += " -Wl,--end-group";
LinkAction.CommandArguments += " -Wl,--start-group";
LinkAction.CommandArguments += ExternalLibraries;
LinkAction.CommandArguments += " -Wl,--end-group";
LinkAction.CommandArguments += " -lrt"; // needed for clock_gettime()
LinkAction.CommandArguments += " -lm"; // math
if (ShouldUseLibcxx(LinkEnvironment.Architecture))
{
// libc++ and its abi lib
LinkAction.CommandArguments += " -nodefaultlibs";
LinkAction.CommandArguments += " -L" + "ThirdParty/Linux/LibCxx/lib/Linux/" + LinkEnvironment.Architecture + "/";
LinkAction.CommandArguments += " " + "ThirdParty/Linux/LibCxx/lib/Linux/" + LinkEnvironment.Architecture + "/libc++.a";
LinkAction.CommandArguments += " " + "ThirdParty/Linux/LibCxx/lib/Linux/" + LinkEnvironment.Architecture + "/libc++abi.a";
LinkAction.CommandArguments += " -lm";
LinkAction.CommandArguments += " -lc";
LinkAction.CommandArguments += " -lgcc_s";
LinkAction.CommandArguments += " -lgcc";
}
// these can be helpful for understanding the order of libraries or library search directories
//LinkAction.CommandArguments += " -Wl,--verbose";
//LinkAction.CommandArguments += " -Wl,--trace";
//LinkAction.CommandArguments += " -v";
// Add the additional arguments specified by the environment.
LinkAction.CommandArguments += LinkEnvironment.AdditionalArguments;
LinkAction.CommandArguments = LinkAction.CommandArguments.Replace("\\\\", "/");
LinkAction.CommandArguments = LinkAction.CommandArguments.Replace("\\", "/");
// prepare a linker script
FileReference LinkerScriptPath = FileReference.Combine(LinkEnvironment.LocalShadowDirectory, "remove-sym.ldscript");
if (!DirectoryReference.Exists(LinkEnvironment.LocalShadowDirectory))
{
DirectoryReference.CreateDirectory(LinkEnvironment.LocalShadowDirectory);
}
if (FileReference.Exists(LinkerScriptPath))
{
FileReference.Delete(LinkerScriptPath);
}
using (StreamWriter Writer = File.CreateText(LinkerScriptPath.FullName))
{
Writer.WriteLine("UE4 {");
Writer.WriteLine(" global: *;");
Writer.WriteLine(" local: _Znwm;");
Writer.WriteLine(" _ZnwmRKSt9nothrow_t;");
Writer.WriteLine(" _Znam;");
Writer.WriteLine(" _ZnamRKSt9nothrow_t;");
Writer.WriteLine(" _ZdaPv;");
Writer.WriteLine(" _ZdaPvRKSt9nothrow_t;");
Writer.WriteLine(" _ZdlPv;");
Writer.WriteLine(" _ZdlPvRKSt9nothrow_t;");
// 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*;");
Writer.WriteLine("};");
};
LinkAction.CommandArguments += string.Format(" -Wl,--version-script=\"{0}\"", LinkerScriptPath);
// Only execute linking on the local PC.
LinkAction.bCanExecuteRemotely = false;
// 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.bIsCrossReferenced && LinkEnvironment.bIsBuildingDLL)
{
bool bUseCmdExe = BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Win64 || BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Win32;
string ScriptName = bUseCmdExe ? "FixDependencies.bat" : "FixDependencies.sh";
string FixDepsScriptPath = Path.Combine(LinkEnvironment.LocalShadowDirectory.FullName, ScriptName);
if (!bHasWipedFixDepsScript)
{
bHasWipedFixDepsScript = true;
Log.TraceVerbose("Creating script: {0}", FixDepsScriptPath);
StreamWriter Writer = File.CreateText(FixDepsScriptPath);
if (bUseCmdExe)
{
Writer.Write("@echo off\n");
Writer.Write("rem Automatically generated by UnrealBuildTool\n");
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();
}
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)));
if (!bUseCmdExe)
{
FixDepsScript.Write(string.Format("TIMESTAMP=`stat --format %y \"{0}\"`\n", OutputFile.AbsolutePath));
}
string FixDepsLine = LinkAction.CommandPath + " " + LinkAction.CommandArguments;
string Replace = "-Wl,--allow-shlib-undefined";
FixDepsLine = FixDepsLine.Replace(Replace, EngineAndGameLibrariesString);
string OutputFileForwardSlashes = OutputFile.AbsolutePath.Replace("\\", "/");
FixDepsLine = FixDepsLine.Replace(OutputFileForwardSlashes, OutputFileForwardSlashes + ".fixed");
FixDepsLine = FixDepsLine.Replace("$", "\\$");
FixDepsScript.Write(FixDepsLine + "\n");
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));
}
FixDepsScript.Close();
}
if (CrossCompiling())
{
LinkAction.OutputEventHandler = new DataReceivedEventHandler(CrossCompileOutputReceivedDataEventHandler);
}
return OutputFile;
}
public override void CompileCSharpProject(CSharpEnvironment CompileEnvironment, FileReference ProjectFileName, FileReference DestinationFile, ActionGraph ActionGraph)
{
throw new BuildException("Linux cannot compile C# files");
}
public override void SetupBundleDependencies(List<UEBuildBinary> Binaries, string GameName)
{
foreach (UEBuildBinary Binary in Binaries)
{
BundleDependencies.Add(FileItem.GetItemByFileReference(Binary.Config.OutputFilePath));
}
}
/// <summary>
/// Converts the passed in path from UBT host to compiler native format.
/// </summary>
public static string ConvertPath(string OriginalPath)
{
if (BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Linux)
{
return OriginalPath.Replace("\\", "/");
}
else
{
return OriginalPath;
}
}
public override ICollection<FileItem> PostBuild(FileItem Executable, LinkEnvironment BinaryLinkEnvironment, ActionGraph ActionGraph)
{
var OutputFiles = base.PostBuild(Executable, BinaryLinkEnvironment, ActionGraph);
if (BinaryLinkEnvironment.bIsBuildingDLL || BinaryLinkEnvironment.bIsBuildingLibrary)
{
return OutputFiles;
}
FileItem FixDepsOutputFile = FixDependencies(BinaryLinkEnvironment, Executable, ActionGraph);
if (FixDepsOutputFile != null)
{
OutputFiles.Add(FixDepsOutputFile);
}
return OutputFiles;
}
public void StripSymbols(FileReference SourceFile, FileReference TargetFile)
{
if (SourceFile != TargetFile)
{
// Strip command only works in place so we need to copy original if target is different
File.Copy(SourceFile.FullName, TargetFile.FullName, true);
}
ProcessStartInfo StartInfo = new ProcessStartInfo();
StartInfo.FileName = GetStripPath(Architecture);
StartInfo.Arguments = "--strip-debug \"" + TargetFile.FullName + "\"";
StartInfo.UseShellExecute = false;
StartInfo.CreateNoWindow = true;
Utils.RunLocalProcessAndLogOutput(StartInfo);
}
}
}