You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb none #lockdown Nick.Penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 3203880 on 2016/11/18 by Ori.Cohen Copying //UE4/Dev-Physics-Upgrade to Dev-Framework (//UE4/Dev-Framework) Change 3207429 on 2016/11/22 by Marc.Audy Merging //UE4/Dev-Main to Dev-Framework (//UE4/Dev-Framework) @ 3207285 Change 3252627 on 2017/01/10 by Lukasz.Furman removed duplicated entries from visual logger shape rendering #ue4 Change 3252675 on 2017/01/10 by Ori.Cohen Add support for tagged memory regions (Copying //Tasks/UE4/Dev-ImmediateModePhysics to Dev-Framework (//UE4/Dev-Framework)) Change 3252686 on 2017/01/10 by Ori.Cohen Refactor BodySetup to make it easier to reuse shape creation (Copying //Tasks/UE4/Dev-ImmediateModePhysics to Dev-Framework (//UE4/Dev-Framework)) Change 3252833 on 2017/01/10 by Ori.Cohen Refactor constraint so that it can be used for external solvers. (Copying //Tasks/UE4/Dev-ImmediateModePhysics to Dev-Framework (//UE4/Dev-Framework)) Change 3252887 on 2017/01/10 by Dan.Reynolds Increased modes to include: Harmonic minor Melodic minor (going up) Pentatonic (Major) Pentatonic (minor) Whole Tone Diminished (WH) and Blues Change 3252895 on 2017/01/10 by Aaron.McLeran update to music utilities. Change 3253060 on 2017/01/10 by Aaron.McLeran Updates to synthesis plugin and some new features to DSP objects Change 3253061 on 2017/01/10 by Aaron.McLeran Updates to music maps Change 3253078 on 2017/01/10 by Aaron.McLeran Removing pragma optimization code accidentally checked in Change 3253110 on 2017/01/10 by Ori.Cohen First iteration of immediate mode ragdoll node (Copying //Tasks/UE4/Dev-ImmediateModePhysics to Dev-Framework (//UE4/Dev-Framework)) Change 3253315 on 2017/01/10 by Aaron.McLeran Fixing a few bugs in DSP objects - Added a new types file EpicSynth1 and EpicSynth1 component can share enums Change 3253577 on 2017/01/11 by Aaron.McLeran Checking in updates to assets for music -- celestial manager for rotating objects like planets, new ambient map Change 3254052 on 2017/01/11 by Ori.Cohen Fix build. Change 3254059 on 2017/01/11 by Ori.Cohen Turn off html5 trying to build apex. Change 3254095 on 2017/01/11 by Ori.Cohen Fix build Change 3254200 on 2017/01/11 by Jon.Nabozny Make vectorized FTransform Accumulate (with blend) and AccumulateWithAdditive (with blend) consistent with the non-vectorized version and comments. #JIRA UE-40469 Change 3254334 on 2017/01/11 by Marc.Audy Put in missing virtual Change 3254397 on 2017/01/11 by dan.reynolds Updates to OtonOkeMap Change 3254410 on 2017/01/11 by Marc.Audy Cleanup autos Change 3254420 on 2017/01/11 by Marc.Audy PR #3110: Add missing IsInAudioThread check (Contributed by projectgheist) Modified somewhat, but based on what PR indicated as a problem. #jira UE-40369 Change 3254423 on 2017/01/11 by Marc.Audy Optimize GetDefaultSubobjectByName and GetDefaultSubobjects Remove autos Change 3254826 on 2017/01/11 by Aaron.McLeran Bringing optimizations to dev-framework Change 3254831 on 2017/01/11 by dan.reynolds Modified MidiSynthTestBP to use Program Change events to pull a Preset from a Preset Bank--added a Data Blueprint Object ES1Bank_Default (containing Preset arrays) with children classes for different classifications of Presets. Change 3254833 on 2017/01/11 by dan.reynolds Updating MidiSynthTestBP's default SynthPreset pan value. Change 3254851 on 2017/01/11 by dan.reynolds Updating ES1Bank_Bass Updating OtonOkeMap Change 3254854 on 2017/01/11 by Aaron.McLeran Some fixups for pan modulation Change 3255682 on 2017/01/12 by aaron.mcleran Turning the bass down a bit on OtonOkeMap Change 3255721 on 2017/01/12 by Marc.Audy Fix spelling error Change 3255790 on 2017/01/12 by Marc.Audy Copying //UE4/Dev-Physics-Upgrade to Dev-Framework (//UE4/Dev-Framework) Change 3256263 on 2017/01/12 by Ori.Cohen Refactor immediate mode api to take PxD6Joint and PxRigidActor instead. Change 3256288 on 2017/01/12 by Ori.Cohen Undo constraint refactor as we found a way around it and it made the code much harder to read/debug Change 3256360 on 2017/01/12 by Ori.Cohen Make sure physx actors passed into immediate mode are done so with proper locks (can probably improve this in the case where the actor is not even in the scene) Change 3256846 on 2017/01/13 by Marc.Audy Deprecate FBox/FBox2D int32 constructor because it makes no sense if you pass in a non 0 value. Use ForceInit instead. Change 3256954 on 2017/01/13 by Marc.Audy Fix missed fixup of deprecated constructor use Change 3257167 on 2017/01/13 by Jon.Nabozny Fix check in FBodyInstance::SetCollisionEnabled. Create convenience methods for HasPhysics and HasQuery. #jira UE-39633 Change 3257181 on 2017/01/13 by Zak.Parrish Adding input map and some testing content to Xenakis Change 3257183 on 2017/01/13 by Mieszko.Zielinski Implemented an improved navigation projection BP function that retrieves both projected locaiton as well as a boolean indicating if the projection succeeded #UE4 Also, did similar changes to GetRandomReachablePointInRadius and GetRandomPointInNavigableRadius #jira UE-40368 Change 3257211 on 2017/01/13 by Jon.Nabozny Fix CIS issue caused by 3257167. Change 3257220 on 2017/01/13 by Marc.Audy Additional FBox constructor deprecation fixups Change 3257236 on 2017/01/13 by zak.parrish Fixed error on Xenakis input pawn Change 3257242 on 2017/01/13 by zak.parrish Update to InputListener Change 3257273 on 2017/01/13 by Marc.Audy No reason to pass simple types by reference Change 3257418 on 2017/01/13 by Ori.Cohen Attempt to turn android physx libs back to static libs. Change 3257445 on 2017/01/13 by Ori.Cohen Turn android libs back to OBJ and removed unreal side linking as it seems we are now just merging into a single physx lib Change 3257903 on 2017/01/14 by Aaron.McLeran Additions to synth module and updates to dsp objects - Adding ability to create arbitrary modular patches from modulating sources to modulation destinations - DSP objects define their default depths but patches can override - Creating new SynthesisEditor module for synthesis plugin so we can create synthesis preset assets - Adding a preset bank type so we can store a bank of presets (aka factory presets) Change 3258179 on 2017/01/15 by Seth.Weedin Duplicating input test map for some FX work Change 3258181 on 2017/01/15 by Seth.Weedin Modify skybox in test map to be dark and spooky Change 3258183 on 2017/01/15 by aaron.johnson substituted classes, changed wind speed and adjusted level lighting Change 3258190 on 2017/01/15 by aaron.johnson substituted triplet pawn and motion controller classes, enabled grabbing animations Change 3258191 on 2017/01/15 by Aaron.McLeran Getting source effects working for GDC demo - Added new synthesis editor module to create instances of user-created source effects - Added code to do source effects - Modified old design to a newer, more simpler design for calling into client code to set parameters. No longer using the complex struct reflection design and instead just pass in the uobject preset the user created. They'll then cast it to the type that has the actual settings. - Tweaks and fixes to existing dsp objects to get source effects working - Modified existing engine code to allow for playing out source effect tails - Only supporting mono and stereo assets for source effect processing. Multi-channel effect processing is overly complex for this feature though we may extend the capabilities in the future. - Fixed issue of pitching with stereo delay effect on setting first interpolated param - Moving synth/dsp stuff in synthesis plugins into appropriate public/private folders in plugin/module - Deleting some cruft files no longer needed Change 3258201 on 2017/01/15 by Seth.Weedin C++ and BP classes for managing grid cells. Initial grid mapping tests. #rb none Change 3258206 on 2017/01/15 by aaron.johnson map push, triplets interface created, debug widget placed in level Change 3258222 on 2017/01/15 by Aaron.McLeran Fixing crash when there's a null entry in the source effect chain Fixed some zippering introduced by applying volume twice. Change 3258225 on 2017/01/15 by aaron.johnson Interface changes, pawn output values wip Change 3258228 on 2017/01/15 by aaron.johnson Pawn should be outputting all correct values for Tripletsinterface Change 3258242 on 2017/01/15 by Stanley.Hayes Edge lights and Spherical Density Materials Change 3258251 on 2017/01/16 by Seth.Weedin More progress on grid FX. Add curve strength modifiers, begin hooking up interaction. #rb none Change 3258284 on 2017/01/16 by Aaron.McLeran Fixing CIS build error Surprised that MSVC allows that... Change 3258525 on 2017/01/16 by Mieszko.Zielinski Made UGameplayTask::ResourceOverlapPolicy configurable via ini files #UE4 Change 3258537 on 2017/01/16 by Lukasz.Furman fixed duplicated & undo operations not updating navigation area in nav link proxy and nav link component #ue4 Change 3258595 on 2017/01/16 by Marc.Audy Fix static analysis warning Change 3259364 on 2017/01/16 by Mieszko.Zielinski BTTask_RotateToFaceBBEntry comment spelling fix #UE4 #jira UE-40669 Change 3259683 on 2017/01/16 by dan.reynolds Updated Preset Bank System implemented in MidiSynthTestBP and 4 Preset Banks have been started Change 3260244 on 2017/01/17 by Lina.Halper #anim - optimize layer blend node to not create mask weights in run-time but in compile time. #code review: Martin.Wilson Change 3260617 on 2017/01/17 by Ori.Cohen Immediate mode spawns its own actors. Change 3260701 on 2017/01/17 by Ori.Cohen Don't bother blending physics with animation when physics is QueryOnly Change 3260796 on 2017/01/17 by Ori.Cohen EndPhysics tick will no longer be scheduled if QueryOnly is used on a ragdoll. Change 3261207 on 2017/01/17 by Ori.Cohen First iteration of contact enabling/disabling for immediate mode. Change3262010on 2017/01/18 by Marc.Audy Remove some autos Change 3262525 on 2017/01/18 by Lina.Halper Fix crash with required bones index not using property indexing #jira: UE-40786 Change 3263658 on 2017/01/19 by Martin.Wilson Add AnimTechDemo to dev-framework (base third person + feng mao) Change 3263684 on 2017/01/19 by Lina.Halper #anim : layer node - fix allocation change I made by mistake Change 3264523 on 2017/01/19 by Ori.Cohen Immediate mode can now add static geometry it finds in the world. Also improve contact gen by caching iteration order Change 3264701 on 2017/01/19 by Ori.Cohen Make it so that immediate mode ragdolls collide with the ground in persona.This is a bit of an editor only hack which allows immediate mode to find non-static actors Change 3264980 on 2017/01/19 by Ori.Cohen Make sure physics asset collision disabled works in immediate mode. Change 3265011 on 2017/01/19 by Ori.Cohen Added the ability to override physics asset for immediate mode Change 3265030 on 2017/01/19 by Ori.Cohen Added override gravity for immediate mode. Change 3265650 on 2017/01/20 by Benn.Gallagher NvCloth Source Change 3265652 on 2017/01/20 by Benn.Gallagher NvCloth Lib #rnx Change 3265653 on 2017/01/20 by Benn.Gallagher NvCloth Bin #rnx Change 3266195 on 2017/01/20 by Danny.Bouimad Initial ClothTest Assets for NCloth Before and after comparison TM-MultiClothTest (Under Maps>Framework>Cloth) Change 3266377 on 2017/01/20 by Marc.Audy Ensure that OrphanedDataOnly and TrashClass blueprint generated classes are correctly considered a blueprint class for disregard for GC purposes. Change 3267873 on 2017/01/23 by Jon.Nabozny Fix SceneProxy shadowing in UGeometryCacheComponent. Change 3268025 on 2017/01/23 by Benn.Gallagher IWYU change, platform PCH generation seemed to hide this one. Change 3268026 on 2017/01/23 by Benn.Gallagher Fixed LOCTEXT_NAMESPACE being inconsistently scoped in an #if block #rnx Change 3268630 on 2017/01/23 by Zak.Parrish Updating to add MIGS shooter content, as well as audio interaction Blueprints Change 3268663 on 2017/01/23 by Ori.Cohen Ragdoll animnode uses raw physics asset pointer to ensure it makes a hard reference. Change 3268811 on 2017/01/23 by Ori.Cohen Added component space sim for immediate mode Change 3269369 on 2017/01/24 by Benn.Gallagher Copying //Tasks/UE4/Dev-UEFW-11-NewClothingPipeline to Dev-Framework (//UE4/Dev-Framework) Replaced clothing with new simulation framework Change 3269417 on 2017/01/24 by danny.bouimad Minor Update to cloth map for test Change 3269420 on 2017/01/24 by Benn.Gallagher Removed APEX simulation from clothing framework (used in testing, not fully complete) Change 3269421 on 2017/01/24 by danny.bouimad Small tweaks Change 3269515 on 2017/01/24 by Lukasz.Furman enabled gameplay debugger's OnSelectionChanged event support for both PIE and SIE modes fixed GameplayAbility debugger's category not using IAbilitySystemInterface #ue4 Change3269595on 2017/01/24 by mason.seay Break apart physics asset for crash bug Change 3269819 on 2017/01/24 by Ori.Cohen Make the possibly kinematic actor the first actor in the immediate mode joint. This is consistent with physx vanilla solver. Change 3270364 on 2017/01/24 by Josh.Stoddard upgrade to the latest version of v-HACD: https://github.com/kmammou/v-hacd/tree/master/src/VHACD_Lib commit: 7a09f9d NOTE: only updated windows binaries mac and linux still using old binaries until they can be tested #jira UE-40124 #rb josh.stoddard Change 3271188 on 2017/01/25 by Jurre.deBaare Post-import script support #jira UEFW-80 Change 3271249 on 2017/01/25 by Thomas.Sarkanen Move soundwave-internal curve tables to advanced display Exposing it was confusing to audio people Change 3271586 on 2017/01/25 by Marc.Audy Don't rerun construction scripts twice on a level that has been hidden and reshown #jira UE-40306 Change 3272048 on 2017/01/25 by Ori.Cohen Fix for immediate mode sim when root body is the same as the root bone. Change 3272083 on 2017/01/25 by Ori.Cohen Make sure to warn when component space sim and collision are used together. Also handle it gracefully. Change 3272300 on 2017/01/25 by Ori.Cohen Fix incorrect collision generation when a shape's local pose is not identity. Change 3273195 on 2017/01/26 by Jurre.deBaare Fix for Anim import script crash in GetBonePosesForTime Change 3273204 on 2017/01/26 by Ben.Marsh Ignore PRAGMA_DISABLE_SHADOW_VARIABLE_WARNINGS and PRAGMA_ENABLE_SHADOW_VARIABLE_WARNINGS macros between include directives. Fixes CIS warning with IncludeTool. Change 3273378 on 2017/01/26 by James.Golding In AnimBP editor, call CopyNodeDataToPreviewNode when properties are edited, not just pin defaults changed Change 3273381 on 2017/01/26 by James.Golding Big refactor to PoseDriver - RBF logic now moved into its own class/file - Allow editing of transform and radial scaling per-target - Add support for different falloff functions (not just Gaussian) - Allow driving curves directly, rather than always poses - Add details customization for pose driver node - Edits to PoseDriver settings now take immediate effect, don't need to recompile Change 3273826 on 2017/01/26 by Josh.Stoddard modify VHACD to improve quality of hulls generated by convex decomposition NOTE: mac libs not included - mac editor will use legacy libs for now Change 3273902 on 2017/01/26 by Marc.Audy Merging //UE4/Dev-Main to Dev-Framework (//UE4/Dev-Framework) @ 3273433 Change 3274018 on 2017/01/26 by Ori.Cohen Added immediate physics preview in phat. Change 3274165 on 2017/01/26 by Ori.Cohen PhAT now depends on immediate mode plugin. Fix build #JIRA UE-41179 Change 3275001 on 2017/01/27 by Jurre.deBaare Fix for crash in Persona with Anim Modifiers Change 3275297 on 2017/01/27 by Ori.Cohen Big refactor to iterate over shapes instead of bodies (allows multiple shape per body collision) Change 3275340 on 2017/01/27 by Benn.Gallagher Fixed Paragon clothing crashes during clothing upgrade step, fixed bone mapping not getting updated on reimport with different hierarchy #jira UE-41025 #jira UE-41039 Change3275383on 2017/01/27 by Benn.Gallagher Blacklisted double promotion warning on ps4 NvCloth build #rnx Change 3275426 on 2017/01/27 by Benn.Gallagher Removed CUDA dependencies from NvCloth cmake files Change 3275670 on 2017/01/27 by Ori.Cohen Fix phat ragdoll in immediate mode updating sketal mesh component transform Change 3275673 on 2017/01/27 by Ori.Cohen Add position/velocity iteration to immediate mode Change3276001on 2017/01/27 by Alan.Noon Migrated Immediate Mode Minion Ragdoll Content to GDC AnimTech Project. Updated DefaultInput.ini none Change3276596on 2017/01/28 by Aaron.McLeran Removing unused #ifdef Change3276597on 2017/01/28 by Aaron.McLeran Getting rid of static analysis warning Change 3277354 on 2017/01/30 by Lukasz.Furman fixed custom navlink Id collisions #ue4 Change 3277356 on 2017/01/30 by Lukasz.Furman fixed comments in GameplayDebugger.h #jira UE-41103 Change 3277371 on 2017/01/30 by mason.seay Test map for spawn sound/force feedback bug. Change 3277445 on 2017/01/30 by Lukasz.Furman fixed compilation warning #ue4 Change 3277560 on 2017/01/30 by Danny.Bouimad Made checkin to Fix Crash that occured due to bad content. Change 3277567 on 2017/01/30 by Ori.Cohen Fix immediate mode crashing when joint is empty. #JIRA UE-41026 Change 3277928 on 2017/01/30 by Ori.Cohen Turn on immediate mode plugin by default Change 3278433 on 2017/01/30 by Ori.Cohen Immediate mode supports heightfield collision. Change 3278449 on 2017/01/30 by Ori.Cohen Fix immediate mode cache not being initialized properly. Change 3278787 on 2017/01/31 by James.Golding Fix CIS error in ImmediatePhysicsSimulation.cpp Change 3279303 on 2017/01/31 by mason.seay Assets for RigidBody node bug Change 3279352 on 2017/01/31 by Benn.Gallagher Fixed inertia blends on self collision cloth assets as we now only have local space simulation and these values weren't used before Change 3279377 on 2017/01/31 by Alan.Noon GDC AnimTech Demo: adjusted minion physics assets none Change 3279425 on 2017/01/31 by james.cobbett Updating QA-Physics map. Made one of the simulated physics objects more user-friendly, able to enable/disable physics on key-press now. Change 3279436 on 2017/01/31 by Benn.Gallagher Fixed inertia scales on Owen mesh Change 3279480 on 2017/01/31 by Benn.Gallagher Fixes for clothing behavior changes #jira UE-41092 Change3279495on 2017/01/31 by Ori.Cohen Remove unneeded cache clearing when contact pairs are not skipped, but there is no collision. Change 3279579 on 2017/01/31 by james.cobbett Added new scenario to QA-Physics map. Moving platforms (up/down, left/right) with physics objects on them. Change 3279695 on 2017/01/31 by mason.seay RigidBody node test asset Change 3280105 on 2017/01/31 by Ori.Cohen Prevent query only ragdolls from simulating if their bodysetup is marked as simulated. Also remove slow check in term body for owning components. This is not true for destructibles or immediate mode Change 3280148 on 2017/01/31 by mason.seay First round of assets for force feedback testing Change 3280860 on 2017/02/01 by James.Golding Merge CL 3280853 to Dev-Framework Fix crash with null CurrentSkeleton on AnimInstance when using Re-import button in SkelMesh Editor Change 3281172 on 2017/02/01 by Marc.Audy Merging //UE4/Dev-Main to Dev-Framework (//UE4/Dev-Framework) @ 3281156 Change 3281210 on 2017/02/01 by james.cobbett Updated QA-Physics map Added cube that starts off with physics enabled, then disables. Made physics toggleable on that and another cube. Change 3281211 on 2017/02/01 by James.Golding Details customization for editing PoseDriver targets list Change 3281332 on 2017/02/01 by Marc.Audy Fix bad merge Fix file types Change 3281388 on 2017/02/01 by mason.seay Updated Force Feedback asset Change 3281396 on 2017/02/01 by mason.seay moving asset Change 3281987 on 2017/02/01 by Benn.Gallagher Fixed project generation failing after main merge Change 3282047 on 2017/02/01 by Marc.Audy Fix up Target and build cs files after changes from Dev-Build Change 3282214 on 2017/02/01 by Ori.Cohen Expose radial forces to immediate mode Change 3282221 on 2017/02/01 by Alan.Noon Immediate Mode GDC demo content: development on minion anim B, refined Orbital Laser Pawn controls, tweaked laser parameters none Change 3282273 on 2017/02/01 by Ori.Cohen Fix crash when recompiling animbp of immediate mode due to null pointer. Change 3282368 on 2017/02/01 by Ori.Cohen Quick iteration on minion demo Change 3282824 on 2017/02/02 by James.Golding Fix for CIS in RBFSolver.h Change 3282829 on 2017/02/02 by James.Golding Fix CIS in PoseDriverDetails.cpp Fix list UI not refreshing after copying targets from PoseAsset Change 3282834 on 2017/02/02 by Danny.Bouimad Adding Pose driver additive assets Change 3282863 on 2017/02/02 by James.Golding Add Mambo mesh and Skeleton Change 3282892 on 2017/02/02 by James.Golding Copy Aurora (Ice) and Mambo meshes/materials/some anims from Dev-General to AnimTechDemo project in Dev-Framework Change 3283157 on 2017/02/02 by Mieszko.Zielinski Cook Orion Win64 fix #UE4 Had to change the Extent param of K2_ProjectPointToNavigation. Updated the error causing Orion BP Change 3283159 on 2017/02/02 by Marc.Audy Additional CIS fixes Change 3283179 on 2017/02/02 by Marc.Audy More CIS fixes Change 3283197 on 2017/02/02 by Jurre.deBaare Fix for issues importing Fornite geometry cache assets #fix Use actual import number of frames instead of total number of frames in the Alembic Cache Change 3283201 on 2017/02/02 by Marc.Audy Keep fixing CIS Change 3283270 on 2017/02/02 by James.Golding Merging CL 3276013 to Dev-Framework - fix issue with additive pose preview applying twice Change 3283499 on 2017/02/02 by Marc.Audy More CIS fixes Change 3283543 on 2017/02/02 by Jon.Nabozny Update comment on AActor::GetActorBounds to properly reflect ChildActorComponents aren't included in the calculation. Change 3283663 on 2017/02/02 by Ori.Cohen Fix potential null dereference in ragdoll node Change 3283757 on 2017/02/02 by Marc.Audy May fix remaining CIS issues Change 3283984 on 2017/02/02 by Marc.Audy Fix linux CIS Change 3284039 on 2017/02/02 by Marc.Audy Merging //UE4/Dev-Main to Dev-Framework (//UE4/Dev-Framework) @ 3283913 Change 3284067 on 2017/02/02 by Marc.Audy Fixup mistakes in converting redirects Change 3284187 on 2017/02/02 by Ori.Cohen Immediate mode works with radial force (not just radial impulse) Change 3284358 on 2017/02/02 by Ori.Cohen Update arcblade phys asset for immediate mode Change 3284667 on 2017/02/02 by Marc.Audy Arguments is an array not a string now. Fixing commented out code. Change 3284684 on 2017/02/02 by Marc.Audy Move AVIWriter out in to its own module to avoid any possible unity build issues where xwindows.h got indirectly included through the DirectShow third party library and caused FGenericWindow::IsMaximized and IsMinimized to conflict with a macro. Change 3284707 on 2017/02/02 by Marc.Audy Fix AVIWriter module compilation on Mac Change 3285012 on 2017/02/03 by Benn.Gallagher Fixes for Dx NvCloth shader warnings Change 3285016 on 2017/02/03 by Marc.Audy Fix missing include Change 3285048 on 2017/02/03 by Benn.Gallagher Fixed Persona needing a restart when changing number of clothing assets (import/delete) #jira UE-41323 Change 3285325 on 2017/02/03 by Marc.Audy Properly implement AVIWriter module Change 3285538 on 2017/02/03 by Marc.Audy Merging //UE4/Dev-Main to Dev-Framework (//UE4/Dev-Framework) @ 3285499 Change 3285735 on 2017/02/03 by Jon.Nabozny Add IsInAir method to UVehicleWheel. #jira UE-38369 Change 3285862 on 2017/02/03 by Aaron.McLeran UE-41435 Fixing PIE audio - Fixing PIE audio. Recent change to editor preferences from Dev-Editor branch (CL 3234495) caused all audio to be muted in PIE. Change 3285914 on 2017/02/03 by danny.bouimad RecomputeTangents Test Assets Change 3286246 on 2017/02/03 by Mieszko.Zielinski Changes to game-specific BPs containing calls to deprecated NavigationSystem functions #UE4 #jira UE-41527 #jira UE-41518 Change 3286308 on 2017/02/03 by Ori.Cohen Make sure physx trimesh scale is never too small. Fix box clamping being ignored. Fixes cook warnings for Odin. #JIRA UE-41529 Change 3286396 on 2017/02/03 by Ori.Cohen Fix CIS Change 3286479 on 2017/02/03 by Ori.Cohen Copying //UE4/Dev-Physics-Upgrade to Dev-Framework (//UE4/Dev-Framework) Change 3287421 on 2017/02/06 by James.Golding Merging //UE4/Dev-Main to Dev-Framework (//UE4/Dev-Framework) @ 3286819 Change 3287427 on 2017/02/06 by James.Golding Fix PoseBlendNode to 'pass through' if no poses are activated Change 3287430 on 2017/02/06 by James.Golding - Add support to PoseDriver for evaluating source bone in the space of a different bone - Fix driven bone adding a scale of 1 - Fix posedriver values 'sticking' (reset all weights to zero each frame) - Move CopyTargetsFromPoseAsset and AutoSetTargetScales from FAnimNode_PoseDriver to UAnimGraphNode_PoseDriver (not required outside editor) - Tranlsation targets now draw larger when selected - 'Copy from pose asset' now also auto-sets radius for you - Remove spammy warnings for missing poses/curves - Add UPoseAsset::GetNumTracks and ::GetFullPose - Remove unused ExtractionContext from UPoseAsset::GetBaseAnimationPose - Remove bIncludeRefPoseAsNeutralPose option (not really useful since we no longer always normalize weights to 1.0) Change 3287496 on 2017/02/06 by Chad.Garyet fixing busted quotes around defaultvalues Change 3287569 on 2017/02/06 by Mieszko.Zielinski Orion BP fixed after deprecating NavigationSystem's BP API #Orion Change 3287595 on 2017/02/06 by Benn.Gallagher BuildPhysX.Automation: Deploying PhysX & NvCloth Win64 Win32 PS4 libs. Built for new NvCloth upgrade Change 3287598 on 2017/02/06 by Benn.Gallagher NvCloth Upgrade to 21604115 Added Linux+Mac support Change 3287710 on 2017/02/06 by Lukasz.Furman added option to disable navlink polys at the end of generated paths #ue4 Change 3287857 on 2017/02/06 by Benn.Gallagher Fixed NvCloth module files to correctly set up linux and mac hopefully Change 3287894 on 2017/02/06 by Benn.Gallagher Another fix to NvCloth build files, didn't get picked up in VS for some reason. Change 3287917 on 2017/02/06 by Lina.Halper Copy from CharacterRigging to Dev-Framework #code review:Thomas.Sarkanen, Martin.Wilson, James.Golding, Andrew.Rodham Change 3287938 on 2017/02/06 by Thomas.Sarkanen Fix crash opening a media sound wave #jira UE-41582 - Editor crashes when running Automation test Change 3287942 on 2017/02/06 by Marc.Audy Merging //UE4/Dev-Main to Dev-Framework (//UE4/Dev-Framework) @ 3287682 Change 3288035 on 2017/02/06 by James.Golding Remove C++ GameMode and pawn classes (replace with floating BP instead) Resave anims to remove Orion refs Add simple AnimBP and map for Mambo testing Change 3288036 on 2017/02/06 by Benn.Gallagher Fix to BuildPhysX task to trigger Mac and Linux builds properly Change 3288125 on 2017/02/06 by Ori.Cohen Change PhysXCommon back to dylib Change 3288127 on 2017/02/06 by Benn.Gallagher Fixed project file identification not working for NvCloth under XCode Change 3288156 on 2017/02/06 by Benn.Gallagher Disable "expansion-to-defined" warning in Linux NvCloth builds Change 3288159 on 2017/02/06 by Lina.Halper potential compile fix for Ocean Editor #code review:Thomas.Sarkanen Change 3288190 on 2017/02/06 by Ori.Cohen Link against static PhysXCommon for mac Change 3288200 on 2017/02/06 by Marc.Audy Fix CIS Change 3288270 on 2017/02/06 by Lina.Halper fix compile error #code review:Thomas.Sarkanen, Marc.Audy Change 3288302 on 2017/02/06 by Thomas.Sarkanen Fixed ensure when deselecting bones in anim BP editor #jira UE-41274 - Ensure when clicking in the viewport of an animation blueprint Change 3288348 on 2017/02/06 by Lina.Halper - Enabled control rig - Changed plugin name to be Control Rig Change 3288490 on 2017/02/06 by Benn.Gallagher Fixes for Mac attempting static links against NvCloth and failing to load dynamic libraries. Worked with MasonS to get Mac editor up and running. Change 3288511 on 2017/02/06 by Lina.Halper compile fix Change 3288513 on 2017/02/06 by Lina.Halper Check in content to work with Change 3288615 on 2017/02/06 by Ori.Cohen Fix skeletal mesh not simulating when using an aggregate. #JIRA UE-41593 Change 3288791 on 2017/02/06 by thomas.sarkanen Exposed transforms to cinematics so they can be animated Change3288795on 2017/02/06 by Ori.Cohen Fix lock warnings for physx #JIRA UE-41591 Change 3288817 on 2017/02/06 by Charles.Anderson GDC Arcblade setup tests. Change 3288825 on 2017/02/06 by Lina.Halper Fix build issue of shadow variable Change 3289058 on 2017/02/06 by Ori.Cohen Fix crash when immediate mode constraint generates 0 rows. This is a potentially temporary fix until NVIDIA replies with a better solution. #JIRA UE-41026 Change 3289348 on 2017/02/06 by Lina.Halper fix compile issue Change 3289369 on 2017/02/06 by Lina.Halper Renamed leg control to limb control and will be used for arm/feet. - changed vars. - has unused variables that will be used soon but want to check in so that i don't block content change on BaseHuman. #code review:Thomas.Sakanen Change 3289422 on 2017/02/06 by Lina.Halper Fixed IK sinking issue - or moving #code review:Thomas.Sarkanen Change 3289433 on 2017/02/06 by Lina.Halper Fixed real shadow error Change 3289485 on 2017/02/06 by Lina.Halper fixed build issue Change 3289657 on 2017/02/07 by thomas.sarkanen Added rig bone mapping to Ice's skeletal mesh Change 3289658 on 2017/02/07 by thomas.sarkanen Added ControlRig map with Ice setup to pose Change 3289662 on 2017/02/07 by Thomas.Sarkanen Fixed up static analysis warning Change 3289663 on 2017/02/07 by Thomas.Sarkanen Fixed crash when attempting to bind to skeletal mesh with already-set anim BP Anim instance may not have actually been created when binding, so dont dereference it Change 3289717 on 2017/02/07 by Benn.Gallagher Switch Linux NvCloth to static for Linux builds. Adjust lib directory to match actual directory Change 3289718 on 2017/02/07 by Benn.Gallagher BuildPhysX.Automation: Deploying NvCloth Linux_x86_64-unknown-linux-gnu libs. Change 3289744 on 2017/02/07 by Benn.Gallagher Fixed missing masses causing crash initialising clothing actors #jira UE-41599 Change 3289746 on 2017/02/07 by Danny.Bouimad Adding Some Content for JamesG he wanted some nicer looking Pose driver test files. Change 3289756 on 2017/02/07 by danny.bouimad Changing the asset for JamesG. Change 3289785 on 2017/02/07 by James.Golding Replace old PoseDrive test with Danny's new one Change 3289858 on 2017/02/07 by Lina.Halper fixed issue with undo transaction buffer Change 3289860 on 2017/02/07 by Benn.Gallagher Fixed crash after reimporting a clothing asset with the clothing config open and then changing the confg #jira UE-41655 Change3289912on 2017/02/07 by Thomas.Sarkanen Merging using Raven_To_Dev-Framework Originally from CLs 3249471, 3258522, 3260271, 3273791: Sequencer: More work supporting array properties more generically + fixes Change 3289962 on 2017/02/07 by James.Golding Add thickness option to DrawWireDiamond Change 3289963 on 2017/02/07 by James.Golding Add spin option to VectorInputBox Change 3289966 on 2017/02/07 by James.Golding Add weight bar chart to PoseDriver details Stop drawing pose weight text in viewport Fix position targets not drawing larger when selected Change 3290094 on 2017/02/07 by Thomas.Sarkanen Fixed typo in filename (fallout from search and replace) Change 3290119 on 2017/02/07 by Thomas.Sarkanen Manipulators can now have their IK/FK space set on them They are not drawn when the space for the chain that they control is not the same as their setting Also fixed a crash with invalid objects when reloading maps. Change 3290145 on 2017/02/07 by Thomas.Sarkanen CIS fix for fallout from Raven changes #jira UE-41670 - Mac editor fails to compile with PropertyTrackEditor errors Change 3290319 on 2017/02/07 by Marc.Audy Make sound player nodes hard reference the assets unless they are in a chain below a quality node. Change 3290484 on 2017/02/07 by Richard.Hinckley Fixing grammar in popup messages. Change 3290533 on 2017/02/07 by Marc.Audy Make GetAIController BlueprintPure #jira UE-41654 Change 3290624 on 2017/02/07 by Marc.Audy Reorder header to avoid include tool warnings Change 3290697 on 2017/02/07 by Lina.Halper - support FK manipulator being in local space - fixed FK key spamming issue for making blend weight to be not keyable - this creates conflicts with enum #code review: Thomas.Sarkanen Change 3290748 on 2017/02/07 by Ori.Cohen Touch immediate mode file to force physx re-link Change 3290807 on 2017/02/07 by Richard.Hinckley #jira UE-39891 Updates to assist in automatic documentation generation. Change 3290946 on 2017/02/07 by Lina.Halper Fix issue of notify looping. #jira: UE-31463 #Code review:Martin.Wilson Change 3291553 on 2017/02/07 by Lina.Halper Rename/move file(s) - modified mesh mapping controller window to be Control Rig Change 3291571 on 2017/02/07 by Lina.Halper added set up spine option #code review:Thomas.Sarkanen Change 3291581 on 2017/02/07 by Ori.Cohen Temporarily turn off phat immediate mode preview which crashes. Change 3291949 on 2017/02/08 by James.Golding Merging //UE4/Dev-Main to Dev-Framework (//UE4/Dev-Framework) @ 3291819 Change 3291966 on 2017/02/08 by Lina.Halper Fix issue with notify looping bug #jira: UE-31463 Change 3292247 on 2017/02/08 by Marc.Audy Clean up bad merge caused by Fortnite integration to main Change 3292326 on 2017/02/08 by Marc.Audy Merging //UE4/Dev-Main to Dev-Framework (//UE4/Dev-Framework) @ 3292313 Change 3292409 on 2017/02/08 by Marc.Audy Resubmit FortPawn.cpp with proper code even though perforce doesn't think there is a difference since when you sync it, the contents are wrong. Change 3292481 on 2017/02/08 by Ori.Cohen Fix for convex hull cooking (from Josh.S) #JIRA UE-41656 Change 3292492 on 2017/02/08 by Mieszko.Zielinski Redone replacement of deprecated navigation system's BP functions in Fortnite BPs #Fortnite Change 3292778 on 2017/02/08 by Ori.Cohen Touch physx DDC key for new cooking. #JIRA UE-41656 [CL3293329by Marc Audy in Main branch]
1573 lines
61 KiB
C#
1573 lines
61 KiB
C#
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Threading;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using Microsoft.Win32;
|
|
using System.Diagnostics;
|
|
using System.Text.RegularExpressions;
|
|
using AutomationTool;
|
|
using UnrealBuildTool;
|
|
|
|
[Help("Builds PhysX/APEX libraries using CMake build system.")]
|
|
[Help("TargetLibs", "Specify a list of target libraries to build, separated by '+' characters (eg. -TargetLibs=PhysX+APEX). Default is PhysX+APEX.")]
|
|
[Help("TargetPlatforms", "Specify a list of target platforms to build, separated by '+' characters (eg. -TargetPlatforms=Win32+Win64). Architectures are specified with '-'. Default is Win32+Win64+PS4.")]
|
|
[Help("TargetConfigs", "Specify a list of configurations to build, separated by '+' characters (eg. -TargetConfigs=profile+debug). Default is profile+release+checked.")]
|
|
[Help("TargetWindowsCompilers", "Specify a list of target compilers to use when building for Windows, separated by '+' characters (eg. -TargetCompilers=VisualStudio2012+VisualStudio2015). Default is VisualStudio2013+VisualStudio2015.")]
|
|
[Help("SkipBuild", "Do not perform build step. If this argument is not supplied libraries will be built (in accordance with TargetLibs, TargetPlatforms and TargetWindowsCompilers).")]
|
|
[Help("SkipDeployLibs", "Do not perform library deployment to the engine. If this argument is not supplied libraries will be copied into the engine.")]
|
|
[Help("SkipDeploySource", "Do not perform source deployment to the engine. If this argument is not supplied source will be copied into the engine.")]
|
|
[Help("SkipCreateChangelist", "Do not create a P4 changelist for source or libs. If this argument is not supplied source and libs will be added to a Perforce changelist.")]
|
|
[Help("SkipSubmit", "Do not perform P4 submit of source or libs. If this argument is not supplied source and libs will be automatically submitted to Perforce. If SkipCreateChangelist is specified, this argument applies by default.")]
|
|
[RequireP4]
|
|
class BuildPhysX : BuildCommand
|
|
{
|
|
const int InvalidChangeList = -1;
|
|
|
|
// The libs we can optionally build
|
|
private enum PhysXTargetLib
|
|
{
|
|
PhysX,
|
|
APEX, // Note: Building APEX deploys shared binaries and libs
|
|
NvCloth
|
|
}
|
|
|
|
private struct TargetPlatformData
|
|
{
|
|
public UnrealTargetPlatform Platform;
|
|
public string Architecture;
|
|
|
|
public TargetPlatformData(UnrealTargetPlatform InPlatform)
|
|
{
|
|
Platform = InPlatform;
|
|
// Linux never has an empty architecture. If we don't care then it's x86_64-unknown-linux-gnu
|
|
Architecture = (Platform == UnrealTargetPlatform.Linux) ? "x86_64-unknown-linux-gnu" : "";
|
|
}
|
|
public TargetPlatformData(UnrealTargetPlatform InPlatform, string InArchitecture)
|
|
{
|
|
Platform = InPlatform;
|
|
Architecture = InArchitecture;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return Architecture == "" ? Platform.ToString() : Platform.ToString() + "_" + Architecture;
|
|
}
|
|
}
|
|
|
|
// Apex libs that do not have an APEX prefix in their name
|
|
private static string[] APEXSpecialLibs = { "NvParameterized", "RenderDebug" };
|
|
|
|
// We cache our own MSDev and MSBuild executables
|
|
private static UnrealBuildTool.FileReference MsDev14Exe;
|
|
private static UnrealBuildTool.FileReference MsBuildExe;
|
|
|
|
// Cache directories under the PhysX/ directory
|
|
private static UnrealBuildTool.DirectoryReference PhysXSourceRootDirectory = UnrealBuildTool.DirectoryReference.Combine(CommandUtils.RootDirectory, "Engine", "Source", "ThirdParty", "PhysX");
|
|
private static UnrealBuildTool.DirectoryReference PhysX34SourceRootDirectory = UnrealBuildTool.DirectoryReference.Combine(PhysXSourceRootDirectory, "PhysX_3.4");
|
|
private static UnrealBuildTool.DirectoryReference APEX14SourceRootDirectory = UnrealBuildTool.DirectoryReference.Combine(PhysXSourceRootDirectory, "APEX_1.4");
|
|
private static UnrealBuildTool.DirectoryReference NvClothSourceRootDirectory = UnrealBuildTool.DirectoryReference.Combine(PhysXSourceRootDirectory, "NvCloth");
|
|
private static UnrealBuildTool.DirectoryReference SharedSourceRootDirectory = UnrealBuildTool.DirectoryReference.Combine(PhysXSourceRootDirectory, "PxShared");
|
|
private static UnrealBuildTool.DirectoryReference RootOutputBinaryDirectory = UnrealBuildTool.DirectoryReference.Combine(CommandUtils.RootDirectory, "Engine", "Binaries", "ThirdParty", "PhysX");
|
|
private static UnrealBuildTool.DirectoryReference RootOutputLibDirectory = UnrealBuildTool.DirectoryReference.Combine(PhysXSourceRootDirectory, "Lib");
|
|
|
|
//private static UnrealBuildTool.DirectoryReference PhysX34SourceLibRootDirectory = UnrealBuildTool.DirectoryReference.Combine(PhysX34SourceRootDirectory, "Lib");
|
|
//private static UnrealBuildTool.DirectoryReference APEX14SourceLibRootDirectory = UnrealBuildTool.DirectoryReference.Combine(APEX14SourceRootDirectory, "Lib");
|
|
//private static UnrealBuildTool.DirectoryReference SharedSourceLibRootDirectory = UnrealBuildTool.DirectoryReference.Combine(SharedSourceRootDirectory, "Lib");
|
|
|
|
|
|
//private static UnrealBuildTool.DirectoryReference PhysXEngineBinaryRootDirectory = UnrealBuildTool.DirectoryReference.Combine(UnrealBuildTool.UnrealBuildTool.RootDirectory, "Engine\\Binaries\\ThirdParty\\PhysX");
|
|
//private static UnrealBuildTool.DirectoryReference PhysX34EngineBinaryRootDirectory = UnrealBuildTool.DirectoryReference.Combine(PhysXEngineBinaryRootDirectory, "PhysX-3.4");
|
|
//private static UnrealBuildTool.DirectoryReference APEX14EngineBinaryRootDirectory = UnrealBuildTool.DirectoryReference.Combine(PhysXEngineBinaryRootDirectory, "APEX-1.4");
|
|
//private static UnrealBuildTool.DirectoryReference SharedEngineBinaryRootDirectory = UnrealBuildTool.DirectoryReference.Combine(PhysXEngineBinaryRootDirectory, "PxShared-1.0");
|
|
|
|
private static string GetCMakeNameAndSetupEnv(TargetPlatformData TargetData)
|
|
{
|
|
DirectoryReference CMakeRootDirectory = DirectoryReference.Combine(CommandUtils.RootDirectory, "Engine", "Extras", "ThirdPartyNotUE", "CMake");
|
|
if(BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Linux)
|
|
{
|
|
return "cmake";
|
|
}
|
|
|
|
Environment.SetEnvironmentVariable("CMAKE_ROOT", DirectoryReference.Combine(CMakeRootDirectory, "share").ToString());
|
|
Log("set {0}={1}", "CMAKE_ROOT", Environment.GetEnvironmentVariable("CMAKE_ROOT"));
|
|
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.HTML5:
|
|
return "cmake";
|
|
case UnrealTargetPlatform.Mac:
|
|
case UnrealTargetPlatform.IOS:
|
|
case UnrealTargetPlatform.TVOS:
|
|
return FileReference.Combine(CMakeRootDirectory, "bin", "cmake").ToString();
|
|
default:
|
|
return FileReference.Combine(CMakeRootDirectory, "bin", "cmake.exe").ToString();
|
|
}
|
|
}
|
|
|
|
private static string GetCMakeTargetDirectoryName(TargetPlatformData TargetData, WindowsCompiler TargetWindowsCompiler)
|
|
{
|
|
string VisualStudioDirectoryName;
|
|
switch (TargetWindowsCompiler)
|
|
{
|
|
case WindowsCompiler.VisualStudio2013:
|
|
VisualStudioDirectoryName = "VS2013";
|
|
break;
|
|
case WindowsCompiler.VisualStudio2015:
|
|
VisualStudioDirectoryName = "VS2015";
|
|
break;
|
|
default:
|
|
throw new AutomationException(String.Format("Non-CMake or unsupported windows compiler '{0}' supplied to GetCMakeTargetDirectoryName", TargetWindowsCompiler));
|
|
}
|
|
|
|
switch (TargetData.Platform)
|
|
{
|
|
// Note slashes need to be '/' as this gets string-composed in the CMake script with other paths
|
|
case UnrealTargetPlatform.Win32:
|
|
return "Win32/" + VisualStudioDirectoryName;
|
|
case UnrealTargetPlatform.Win64:
|
|
return "Win64/" + VisualStudioDirectoryName;
|
|
case UnrealTargetPlatform.Android:
|
|
switch (TargetData.Architecture)
|
|
{
|
|
default:
|
|
case "armv7": return "Android/ARMv7";
|
|
case "arm64": return "Android/ARM64";
|
|
case "x86": return "Android/x86";
|
|
case "x64": return "Android/x64";
|
|
}
|
|
case UnrealTargetPlatform.HTML5:
|
|
default:
|
|
return TargetData.Platform.ToString();
|
|
}
|
|
}
|
|
|
|
private static UnrealBuildTool.DirectoryReference GetProjectDirectory(PhysXTargetLib TargetLib, TargetPlatformData TargetData, WindowsCompiler TargetWindowsCompiler = WindowsCompiler.VisualStudio2015)
|
|
{
|
|
UnrealBuildTool.DirectoryReference Directory = new UnrealBuildTool.DirectoryReference(GetTargetLibRootDirectory(TargetLib).ToString());
|
|
|
|
switch(TargetLib)
|
|
{
|
|
case PhysXTargetLib.PhysX:
|
|
Directory = UnrealBuildTool.DirectoryReference.Combine(Directory, "Source");
|
|
break;
|
|
case PhysXTargetLib.APEX:
|
|
// APEX has its 'compiler' directory in a different location off the root of APEX
|
|
break;
|
|
}
|
|
|
|
return UnrealBuildTool.DirectoryReference.Combine(Directory, "compiler", GetCMakeTargetDirectoryName(TargetData, TargetWindowsCompiler));
|
|
}
|
|
|
|
private static string GetLinuxToolchainSettings(TargetPlatformData TargetData)
|
|
{
|
|
if (BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Linux)
|
|
{
|
|
// in native builds we don't really use a crosstoolchain description, just use system compiler
|
|
return " -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++";
|
|
}
|
|
|
|
// otherwise, use a per-architecture file.
|
|
return " -DCMAKE_TOOLCHAIN_FILE=\"" + PhysXSourceRootDirectory + "\\Externals\\CMakeModules\\Linux\\LinuxCrossToolchain.multiarch.cmake\"" + " -DARCHITECTURE_TRIPLE=" + TargetData.Architecture;
|
|
}
|
|
|
|
private static string GetCMakeArguments(PhysXTargetLib TargetLib, TargetPlatformData TargetData, string BuildConfig = "", WindowsCompiler TargetWindowsCompiler = WindowsCompiler.VisualStudio2015)
|
|
{
|
|
string VisualStudioName;
|
|
switch(TargetWindowsCompiler)
|
|
{
|
|
case WindowsCompiler.VisualStudio2013:
|
|
VisualStudioName = "Visual Studio 12 2013";
|
|
break;
|
|
case WindowsCompiler.VisualStudio2015:
|
|
VisualStudioName = "Visual Studio 14 2015";
|
|
break;
|
|
default:
|
|
throw new AutomationException(String.Format("Non-CMake or unsupported platform '{0}' supplied to GetCMakeArguments", TargetData.ToString()));
|
|
}
|
|
|
|
string OutputFlags = " -DPX_OUTPUT_LIB_DIR=" + GetPlatformLibDirectory(TargetData, TargetWindowsCompiler);
|
|
if(PlatformHasBinaries(TargetData))
|
|
{
|
|
OutputFlags += " -DPX_OUTPUT_DLL_DIR=" + GetPlatformBinaryDirectory(TargetData, TargetWindowsCompiler) + " -DPX_OUTPUT_EXE_DIR=" + GetPlatformBinaryDirectory(TargetData, TargetWindowsCompiler);
|
|
}
|
|
|
|
// Enable response files for platforms that require them.
|
|
// Response files are used for include paths etc, to fix max command line length issues.
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.PS4:
|
|
case UnrealTargetPlatform.Linux:
|
|
OutputFlags += " -DUSE_RESPONSE_FILES=1";
|
|
break;
|
|
}
|
|
|
|
string ApexFlags = " -DAPEX_ENABLE_UE4=1";
|
|
switch (TargetLib)
|
|
{
|
|
case PhysXTargetLib.PhysX:
|
|
DirectoryReference PhysXCMakeFiles = DirectoryReference.Combine(PhysX34SourceRootDirectory, "Source", "compiler", "cmake");
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Win32:
|
|
return DirectoryReference.Combine(PhysXCMakeFiles, "Windows").ToString() + " -G \"" + VisualStudioName + "\" -AWin32 -DTARGET_BUILD_PLATFORM=Windows" + OutputFlags;
|
|
case UnrealTargetPlatform.Win64:
|
|
return DirectoryReference.Combine(PhysXCMakeFiles, "Windows").ToString() + " -G \"" + VisualStudioName + "\" -Ax64 -DTARGET_BUILD_PLATFORM=Windows" + OutputFlags;
|
|
case UnrealTargetPlatform.PS4:
|
|
return DirectoryReference.Combine(PhysXCMakeFiles, "PS4").ToString() + " -G \"Unix Makefiles\" -DTARGET_BUILD_PLATFORM=PS4 -DCMAKE_BUILD_TYPE=" + BuildConfig + " -DCMAKE_TOOLCHAIN_FILE=\"" + PhysXSourceRootDirectory + "\\Externals\\CMakeModules\\PS4\\PS4Toolchain.txt\"" + OutputFlags;
|
|
case UnrealTargetPlatform.XboxOne:
|
|
return DirectoryReference.Combine(PhysXCMakeFiles, "XboxOne").ToString() + " -G \"Visual Studio 14 2015\" -DTARGET_BUILD_PLATFORM=XboxOne -DCMAKE_TOOLCHAIN_FILE=\"" + PhysXSourceRootDirectory + "\\Externals\\CMakeModules\\XboxOne\\XboxOneToolchain.txt\" -DCMAKE_GENERATOR_PLATFORM=DURANGO" + OutputFlags;
|
|
case UnrealTargetPlatform.Android:
|
|
string NDKDirectory = Environment.GetEnvironmentVariable("NDKROOT");
|
|
|
|
// don't register if we don't have an NDKROOT specified
|
|
if (String.IsNullOrEmpty(NDKDirectory))
|
|
{
|
|
throw new BuildException("NDKROOT is not specified; cannot build Android.");
|
|
}
|
|
|
|
NDKDirectory = NDKDirectory.Replace("\"", "");
|
|
|
|
string AndroidAPILevel = "android-19";
|
|
string AndroidABI = "armeabi-v7a";
|
|
switch (TargetData.Architecture)
|
|
{
|
|
case "armv7": AndroidAPILevel = "android-19"; AndroidABI = "armeabi-v7a"; break;
|
|
case "arm64": AndroidAPILevel = "android-21"; AndroidABI = "arm64-v8a"; break;
|
|
case "x86": AndroidAPILevel = "android-19"; AndroidABI = "x86"; break;
|
|
case "x64": AndroidAPILevel = "android-21"; AndroidABI = "x86_64"; break;
|
|
}
|
|
return DirectoryReference.Combine(PhysXCMakeFiles, "Android").ToString() + " -G \"MinGW Makefiles\" -DTARGET_BUILD_PLATFORM=Android -DCMAKE_BUILD_TYPE=" + BuildConfig + " -DCMAKE_TOOLCHAIN_FILE=\"" + PhysXSourceRootDirectory + "\\Externals\\CMakeModules\\Android\\android.toolchain.cmake\" -DANDROID_NDK=\"" + NDKDirectory + "\" -DCMAKE_MAKE_PROGRAM=\"" + NDKDirectory + "\\prebuilt\\windows-x86_64\\bin\\make.exe\" -DANDROID_NATIVE_API_LEVEL=\"" + AndroidAPILevel + "\" -DANDROID_ABI=\"" + AndroidABI + "\" -DANDROID_STL=gnustl_shared" + OutputFlags;
|
|
case UnrealTargetPlatform.Linux:
|
|
return DirectoryReference.Combine(PhysXCMakeFiles, "Linux").ToString() + " --no-warn-unused-cli -G \"Unix Makefiles\" -DTARGET_BUILD_PLATFORM=Linux -DPX_STATIC_LIBRARIES=1 -DCMAKE_BUILD_TYPE=" + BuildConfig + GetLinuxToolchainSettings(TargetData) + OutputFlags;
|
|
case UnrealTargetPlatform.Mac:
|
|
return DirectoryReference.Combine(PhysXCMakeFiles, "Mac").ToString() + " -G \"Xcode\" -DTARGET_BUILD_PLATFORM=Mac" + OutputFlags;
|
|
case UnrealTargetPlatform.IOS:
|
|
return DirectoryReference.Combine(PhysXCMakeFiles, "IOS").ToString() + " -G \"Xcode\" -DTARGET_BUILD_PLATFORM=IOS" + OutputFlags;
|
|
case UnrealTargetPlatform.TVOS:
|
|
return DirectoryReference.Combine(PhysXCMakeFiles, "TVOS").ToString() + " -G \"Xcode\" -DTARGET_BUILD_PLATFORM=TVOS" + OutputFlags;
|
|
case UnrealTargetPlatform.Switch:
|
|
return DirectoryReference.Combine(PhysXCMakeFiles, "Switch").ToString() + " -G \"Unix Makefiles\" -DTARGET_BUILD_PLATFORM=Switch -DCMAKE_BUILD_TYPE=" + BuildConfig + " -DCMAKE_TOOLCHAIN_FILE=\"" + PhysXSourceRootDirectory + "\\Externals\\CMakeModules\\Switch\\SwitchToolchain.cmake\"" + OutputFlags;
|
|
case UnrealTargetPlatform.HTML5:
|
|
string CmakeToolchainFile = FileReference.Combine(PhysXSourceRootDirectory, "Externals", "CMakeModules", "HTML5", "Emscripten." + BuildConfig + ".cmake").ToString();
|
|
return DirectoryReference.Combine(PhysXCMakeFiles, "HTML5").ToString() +
|
|
" -G \"Unix Makefiles\" -DTARGET_BUILD_PLATFORM=HTML5" +
|
|
" -DPXSHARED_ROOT_DIR=\"" + SharedSourceRootDirectory.ToString() + "\"" +
|
|
" -DNVSIMD_INCLUDE_DIR=\"" + SharedSourceRootDirectory.ToString() + "/src/NvSimd\"" +
|
|
" -DNVTOOLSEXT_INCLUDE_DIRS=\"" + PhysX34SourceRootDirectory + "/externals/nvToolsExt/include\"" +
|
|
" -DEMSCRIPTEN_GENERATE_BITCODE_STATIC_LIBRARIES=ON " +
|
|
" -DCMAKE_BUILD_TYPE=\"Release\" -DCMAKE_TOOLCHAIN_FILE=\"" + CmakeToolchainFile + "\"" +
|
|
OutputFlags;
|
|
default:
|
|
throw new AutomationException(String.Format("Non-CMake or unsupported platform '{0}' supplied to GetCMakeArguments", TargetData.ToString()));
|
|
}
|
|
case PhysXTargetLib.APEX:
|
|
DirectoryReference ApexCMakeFiles = DirectoryReference.Combine(APEX14SourceRootDirectory, "compiler", "cmake");
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Win32:
|
|
return DirectoryReference.Combine(ApexCMakeFiles, "Windows").ToString() + " -G \"" + VisualStudioName + "\" -AWin32 -DTARGET_BUILD_PLATFORM=Windows" + OutputFlags + ApexFlags;
|
|
case UnrealTargetPlatform.Win64:
|
|
return DirectoryReference.Combine(ApexCMakeFiles, "Windows").ToString() + " -G \"" + VisualStudioName + "\" -Ax64 -DTARGET_BUILD_PLATFORM=Windows" + OutputFlags + ApexFlags;
|
|
case UnrealTargetPlatform.PS4:
|
|
return DirectoryReference.Combine(ApexCMakeFiles, "PS4").ToString() + " -G \"Unix Makefiles\" -DTARGET_BUILD_PLATFORM=PS4 -DCMAKE_BUILD_TYPE=" + BuildConfig + " -DCMAKE_TOOLCHAIN_FILE=\"" + PhysXSourceRootDirectory + "\\Externals\\CMakeModules\\PS4\\PS4Toolchain.txt\"" + OutputFlags + ApexFlags;
|
|
case UnrealTargetPlatform.XboxOne:
|
|
return DirectoryReference.Combine(ApexCMakeFiles, "XboxOne").ToString() + " -G \"Visual Studio 14 2015\" -DTARGET_BUILD_PLATFORM=XboxOne -DCMAKE_TOOLCHAIN_FILE=\"" + PhysXSourceRootDirectory + "\\Externals\\CMakeModules\\XboxOne\\XboxOneToolchain.txt\" -DCMAKE_GENERATOR_PLATFORM=DURANGO" + OutputFlags + ApexFlags;
|
|
case UnrealTargetPlatform.Switch:
|
|
return DirectoryReference.Combine(ApexCMakeFiles, "Switch").ToString() + " -G \"Unix Makefiles\" -DTARGET_BUILD_PLATFORM=Switch -DCMAKE_BUILD_TYPE=" + BuildConfig + " -DCMAKE_TOOLCHAIN_FILE=\"" + PhysXSourceRootDirectory + "\\Externals\\CMakeModules\\Switch\\SwitchToolchain.cmake\"" + OutputFlags + ApexFlags;
|
|
case UnrealTargetPlatform.Linux:
|
|
return DirectoryReference.Combine(ApexCMakeFiles, "Linux").ToString() + " --no-warn-unused-cli -G \"Unix Makefiles\" -DTARGET_BUILD_PLATFORM=Linux -DPX_STATIC_LIBRARIES=1 -DCMAKE_BUILD_TYPE=" + BuildConfig + GetLinuxToolchainSettings(TargetData) + OutputFlags + ApexFlags;
|
|
case UnrealTargetPlatform.Mac:
|
|
return DirectoryReference.Combine(ApexCMakeFiles, "Mac").ToString() + " -G \"Xcode\" -DTARGET_BUILD_PLATFORM=Mac" + OutputFlags + ApexFlags;
|
|
default:
|
|
throw new AutomationException(String.Format("Non-CMake or unsupported platform '{0}' supplied to GetCMakeArguments", TargetData.ToString()));
|
|
}
|
|
case PhysXTargetLib.NvCloth:
|
|
DirectoryReference NvClothCMakeFiles = DirectoryReference.Combine(NvClothSourceRootDirectory, "compiler", "cmake");
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Win32:
|
|
return DirectoryReference.Combine(NvClothCMakeFiles, "Windows").ToString() + " -G \"" + VisualStudioName + "\" -AWin32 -DTARGET_BUILD_PLATFORM=Windows" + OutputFlags;
|
|
case UnrealTargetPlatform.Win64:
|
|
return DirectoryReference.Combine(NvClothCMakeFiles, "Windows").ToString() + " -G \"" + VisualStudioName + "\" -Ax64 -DTARGET_BUILD_PLATFORM=Windows" + OutputFlags;
|
|
case UnrealTargetPlatform.PS4:
|
|
return DirectoryReference.Combine(NvClothCMakeFiles, "PS4").ToString() + " -G \"Unix Makefiles\" -DTARGET_BUILD_PLATFORM=PS4 -DCMAKE_BUILD_TYPE=" + BuildConfig + " -DCMAKE_TOOLCHAIN_FILE=\"" + PhysXSourceRootDirectory + "\\Externals\\CMakeModules\\PS4\\PS4Toolchain.txt\"" + OutputFlags;
|
|
case UnrealTargetPlatform.XboxOne:
|
|
return DirectoryReference.Combine(NvClothCMakeFiles, "XboxOne").ToString() + " -G \"Visual Studio 14 2015\" -DTARGET_BUILD_PLATFORM=XboxOne -DCMAKE_TOOLCHAIN_FILE=\"" + PhysXSourceRootDirectory + "\\Externals\\CMakeModules\\XboxOne\\XboxOneToolchain.txt\" -DCMAKE_GENERATOR_PLATFORM=DURANGO" + OutputFlags;
|
|
case UnrealTargetPlatform.Linux:
|
|
return DirectoryReference.Combine(NvClothCMakeFiles, "Linux").ToString() + " --no-warn-unused-cli -G \"Unix Makefiles\" -DTARGET_BUILD_PLATFORM=Linux -DPX_STATIC_LIBRARIES=1 -DCMAKE_BUILD_TYPE=" + BuildConfig + GetLinuxToolchainSettings(TargetData) + OutputFlags;
|
|
case UnrealTargetPlatform.Mac:
|
|
return DirectoryReference.Combine(NvClothCMakeFiles, "Mac").ToString() + " -G \"Xcode\" -DTARGET_BUILD_PLATFORM=Mac" + OutputFlags;
|
|
|
|
default:
|
|
throw new AutomationException(String.Format("Non-CMake or unsupported platform '{0}' supplied to GetCMakeArguments", TargetData.ToString()));
|
|
}
|
|
default:
|
|
throw new AutomationException(String.Format("Non-CMake or unsupported lib '{0}' supplied to GetCMakeArguments", TargetLib));
|
|
}
|
|
}
|
|
|
|
private static string GetMsDevExe(TargetPlatformData TargetData)
|
|
{
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Win32:
|
|
return MsDev14Exe.ToString();
|
|
case UnrealTargetPlatform.Win64:
|
|
return MsDev14Exe.ToString();
|
|
case UnrealTargetPlatform.XboxOne:
|
|
return MsDev14Exe.ToString();
|
|
default:
|
|
throw new AutomationException(String.Format("Non-MSBuild or unsupported platform '{0}' supplied to GetMsDevExe", TargetData.ToString()));
|
|
}
|
|
}
|
|
|
|
private static string GetMsBuildExe(TargetPlatformData TargetData)
|
|
{
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Win32:
|
|
case UnrealTargetPlatform.Win64:
|
|
case UnrealTargetPlatform.XboxOne:
|
|
return MsBuildExe.ToString();
|
|
default:
|
|
throw new AutomationException(String.Format("Non-MSBuild or unsupported platform '{0}' supplied to GetMsBuildExe", TargetData.ToString()));
|
|
}
|
|
}
|
|
|
|
private static string GetTargetLibSolutionName(PhysXTargetLib TargetLib)
|
|
{
|
|
switch (TargetLib)
|
|
{
|
|
case PhysXTargetLib.PhysX:
|
|
return "PhysX.sln";
|
|
case PhysXTargetLib.APEX:
|
|
return "APEX.sln";
|
|
case PhysXTargetLib.NvCloth:
|
|
return "NvCloth.sln";
|
|
default:
|
|
throw new AutomationException(String.Format("Unknown target lib '{0}' specified to GetTargetLibSolutionName", TargetLib));
|
|
}
|
|
}
|
|
|
|
private static UnrealBuildTool.FileReference GetTargetLibSolutionFileName(PhysXTargetLib TargetLib, TargetPlatformData TargetData, WindowsCompiler TargetWindowsCompiler)
|
|
{
|
|
UnrealBuildTool.DirectoryReference Directory = GetProjectDirectory(TargetLib, TargetData, TargetWindowsCompiler);
|
|
return UnrealBuildTool.FileReference.Combine(Directory, GetTargetLibSolutionName(TargetLib));
|
|
}
|
|
|
|
private static bool DoesPlatformUseMSBuild(TargetPlatformData TargetData)
|
|
{
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Win32:
|
|
case UnrealTargetPlatform.Win64:
|
|
case UnrealTargetPlatform.XboxOne:
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
|
|
private static bool DoesPlatformUseMakefiles(TargetPlatformData TargetData)
|
|
{
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Android:
|
|
case UnrealTargetPlatform.Linux:
|
|
case UnrealTargetPlatform.HTML5:
|
|
case UnrealTargetPlatform.PS4:
|
|
case UnrealTargetPlatform.Switch:
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
|
|
private static bool DoesPlatformUseXcode(TargetPlatformData TargetData)
|
|
{
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Mac:
|
|
case UnrealTargetPlatform.IOS:
|
|
case UnrealTargetPlatform.TVOS:
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
|
|
private static DirectoryReference GetTargetLibRootDirectory(PhysXTargetLib TargetLib)
|
|
{
|
|
switch (TargetLib)
|
|
{
|
|
case PhysXTargetLib.PhysX:
|
|
return PhysX34SourceRootDirectory;
|
|
case PhysXTargetLib.APEX:
|
|
return APEX14SourceRootDirectory;
|
|
case PhysXTargetLib.NvCloth:
|
|
return NvClothSourceRootDirectory;
|
|
default:
|
|
throw new AutomationException(String.Format("Unknown target lib '{0}' specified to GetTargetLibRootDirectory", TargetLib));
|
|
}
|
|
}
|
|
|
|
private List<TargetPlatformData> GetTargetPlatforms()
|
|
{
|
|
List<TargetPlatformData> TargetPlatforms = new List<TargetPlatformData>();
|
|
|
|
// Remove any platforms that aren't enabled on the command line
|
|
string TargetPlatformFilter = ParseParamValue("TargetPlatforms", "Win32+Win64+PS4");
|
|
if (TargetPlatformFilter != null)
|
|
{
|
|
foreach (string TargetPlatformName in TargetPlatformFilter.Split(new char[] { '+' }, StringSplitOptions.RemoveEmptyEntries))
|
|
{
|
|
string[] TargetPlatformAndArch = TargetPlatformName.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries);
|
|
|
|
UnrealTargetPlatform TargetPlatform;
|
|
if (!Enum.TryParse(TargetPlatformAndArch[0], out TargetPlatform))
|
|
{
|
|
throw new AutomationException(String.Format("Unknown target platform '{0}' specified on command line", TargetPlatformName));
|
|
}
|
|
else
|
|
{
|
|
if (TargetPlatformAndArch.Count() == 2)
|
|
{
|
|
TargetPlatforms.Add(new TargetPlatformData(TargetPlatform, TargetPlatformAndArch[1]));
|
|
}
|
|
else if (TargetPlatformAndArch.Count() > 2)
|
|
{
|
|
// Linux archs are OS triplets, so have multiple dashes
|
|
string DashedArch = TargetPlatformAndArch[1];
|
|
for(int Idx = 2; Idx < TargetPlatformAndArch.Count(); ++Idx)
|
|
{
|
|
DashedArch += "-" + TargetPlatformAndArch[Idx];
|
|
}
|
|
TargetPlatforms.Add(new TargetPlatformData(TargetPlatform, DashedArch));
|
|
}
|
|
else
|
|
{
|
|
TargetPlatforms.Add(new TargetPlatformData(TargetPlatform));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
return TargetPlatforms;
|
|
}
|
|
|
|
public List<string> GetTargetConfigurations()
|
|
{
|
|
List<string> TargetConfigs = new List<string>();
|
|
// Remove any configs that aren't enabled on the command line
|
|
string TargetConfigFilter = ParseParamValue("TargetConfigs", "profile+release+checked");
|
|
if (TargetConfigFilter != null)
|
|
{
|
|
foreach(string TargetConfig in TargetConfigFilter.Split(new char[] { '+' }, StringSplitOptions.RemoveEmptyEntries))
|
|
{
|
|
TargetConfigs.Add(TargetConfig);
|
|
}
|
|
}
|
|
|
|
return TargetConfigs;
|
|
}
|
|
|
|
private List<PhysXTargetLib> GetTargetLibs()
|
|
{
|
|
List<PhysXTargetLib> TargetLibs = new List<PhysXTargetLib>();
|
|
string TargetLibsFilter = ParseParamValue("TargetLibs", "PhysX+APEX+NvCloth");
|
|
if (TargetLibsFilter != null)
|
|
{
|
|
foreach (string TargetLibName in TargetLibsFilter.Split(new char[] { '+' }, StringSplitOptions.RemoveEmptyEntries))
|
|
{
|
|
PhysXTargetLib TargetLib;
|
|
if (!Enum.TryParse(TargetLibName, out TargetLib))
|
|
{
|
|
throw new AutomationException(String.Format("Unknown target lib '{0}' specified on command line", TargetLibName));
|
|
}
|
|
else
|
|
{
|
|
TargetLibs.Add(TargetLib);
|
|
}
|
|
}
|
|
}
|
|
return TargetLibs;
|
|
}
|
|
|
|
private List<WindowsCompiler> GetTargetWindowsCompilers()
|
|
{
|
|
List<WindowsCompiler> TargetWindowsCompilers = new List<WindowsCompiler>();
|
|
string TargetWindowsCompilersFilter = ParseParamValue("TargetWindowsCompilers", "VisualStudio2015+VisualStudio2013");
|
|
if (TargetWindowsCompilersFilter != null)
|
|
{
|
|
foreach (string TargetWindowsCompilerName in TargetWindowsCompilersFilter.Split(new char[] { '+' }, StringSplitOptions.RemoveEmptyEntries))
|
|
{
|
|
WindowsCompiler TargetWindowsCompiler;
|
|
if (!Enum.TryParse(TargetWindowsCompilerName, out TargetWindowsCompiler))
|
|
{
|
|
throw new AutomationException(String.Format("Unknown target windows compiler '{0}' specified on command line", TargetWindowsCompilerName));
|
|
}
|
|
else
|
|
{
|
|
TargetWindowsCompilers.Add(TargetWindowsCompiler);
|
|
}
|
|
}
|
|
}
|
|
return TargetWindowsCompilers;
|
|
}
|
|
|
|
private static void MakeFreshDirectoryIfRequired(UnrealBuildTool.DirectoryReference Directory)
|
|
{
|
|
if (!DirectoryReference.Exists(Directory))
|
|
{
|
|
DirectoryReference.CreateDirectory(Directory);
|
|
}
|
|
else
|
|
{
|
|
|
|
InternalUtils.SafeDeleteDirectory(Directory.FullName);
|
|
DirectoryReference.CreateDirectory(Directory);
|
|
}
|
|
}
|
|
|
|
public static int RunLocalProcess(Process LocalProcess)
|
|
{
|
|
int ExitCode = -1;
|
|
|
|
// release all process resources
|
|
using (LocalProcess)
|
|
{
|
|
LocalProcess.StartInfo.UseShellExecute = false;
|
|
LocalProcess.StartInfo.RedirectStandardOutput = true;
|
|
|
|
try
|
|
{
|
|
// Start the process up and then wait for it to finish
|
|
LocalProcess.Start();
|
|
LocalProcess.BeginOutputReadLine();
|
|
LocalProcess.WaitForExit();
|
|
ExitCode = LocalProcess.ExitCode;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw new BuildException(ex, "Failed to start local process for action (\"{0}\"): {1} {2}", ex.Message, LocalProcess.StartInfo.FileName, LocalProcess.StartInfo.Arguments);
|
|
}
|
|
}
|
|
|
|
return ExitCode;
|
|
}
|
|
|
|
public static int RunLocalProcessAndLogOutput(ProcessStartInfo StartInfo)
|
|
{
|
|
Process LocalProcess = new Process();
|
|
LocalProcess.StartInfo = StartInfo;
|
|
LocalProcess.OutputDataReceived += (Sender, Line) => { if (Line != null && Line.Data != null) UnrealBuildTool.Log.TraceInformation(Line.Data); };
|
|
return RunLocalProcess(LocalProcess);
|
|
}
|
|
|
|
private static void SetupBuildForTargetLibAndPlatform(PhysXTargetLib TargetLib, TargetPlatformData TargetData, List<string> TargetConfigurations, List<WindowsCompiler> TargetWindowsCompilers, bool bCleanOnly)
|
|
{
|
|
// make sure we set up the environment variable specifying where the root of the PhysX SDK is
|
|
Environment.SetEnvironmentVariable("GW_DEPS_ROOT", PhysXSourceRootDirectory.ToString());
|
|
Log("set {0}={1}", "GW_DEPS_ROOT", Environment.GetEnvironmentVariable("GW_DEPS_ROOT"));
|
|
Environment.SetEnvironmentVariable("CMAKE_MODULE_PATH", DirectoryReference.Combine(PhysXSourceRootDirectory, "Externals", "CMakeModules").ToString());
|
|
Log("set {0}={1}", "CMAKE_MODULE_PATH", Environment.GetEnvironmentVariable("CMAKE_MODULE_PATH"));
|
|
|
|
string CMakeName = GetCMakeNameAndSetupEnv(TargetData);
|
|
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Win32:
|
|
case UnrealTargetPlatform.Win64:
|
|
// for windows platforms we support building against multiple compilers
|
|
foreach(WindowsCompiler TargetWindowsCompiler in TargetWindowsCompilers)
|
|
{
|
|
UnrealBuildTool.DirectoryReference CMakeTargetDirectory = GetProjectDirectory(TargetLib, TargetData, TargetWindowsCompiler);
|
|
MakeFreshDirectoryIfRequired(CMakeTargetDirectory);
|
|
|
|
if(!bCleanOnly)
|
|
{
|
|
Log("Generating projects for lib " + TargetLib.ToString() + ", " + TargetData.ToString());
|
|
|
|
ProcessStartInfo StartInfo = new ProcessStartInfo();
|
|
StartInfo.FileName = CMakeName;
|
|
StartInfo.WorkingDirectory = CMakeTargetDirectory.ToString();
|
|
StartInfo.Arguments = GetCMakeArguments(TargetLib, TargetData, "", TargetWindowsCompiler);
|
|
|
|
RunLocalProcessAndLogOutput(StartInfo);
|
|
}
|
|
}
|
|
break;
|
|
case UnrealTargetPlatform.PS4:
|
|
case UnrealTargetPlatform.Android:
|
|
case UnrealTargetPlatform.Linux:
|
|
case UnrealTargetPlatform.Switch:
|
|
foreach (string BuildConfig in TargetConfigurations)
|
|
{
|
|
UnrealBuildTool.DirectoryReference CMakeTargetDirectory = GetProjectDirectory(TargetLib, TargetData);
|
|
CMakeTargetDirectory = UnrealBuildTool.DirectoryReference.Combine(CMakeTargetDirectory, BuildConfig);
|
|
MakeFreshDirectoryIfRequired(CMakeTargetDirectory);
|
|
|
|
if (!bCleanOnly)
|
|
{
|
|
Log("Generating projects for lib " + TargetLib.ToString() + ", " + TargetData.ToString());
|
|
|
|
ProcessStartInfo StartInfo = new ProcessStartInfo();
|
|
StartInfo.FileName = CMakeName;
|
|
StartInfo.WorkingDirectory = CMakeTargetDirectory.ToString();
|
|
StartInfo.Arguments = GetCMakeArguments(TargetLib, TargetData, BuildConfig);
|
|
|
|
System.Console.WriteLine("Working in '{0}'", StartInfo.WorkingDirectory);
|
|
Log("Working in '{0}'", StartInfo.WorkingDirectory);
|
|
|
|
System.Console.WriteLine("{0} {1}", StartInfo.FileName, StartInfo.Arguments);
|
|
Log("{0} {1}", StartInfo.FileName, StartInfo.Arguments);
|
|
|
|
if (RunLocalProcessAndLogOutput(StartInfo) != 0)
|
|
{
|
|
throw new AutomationException(String.Format("Unable to generate projects for {0}.", TargetLib.ToString() + ", " + TargetData.ToString()));
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case UnrealTargetPlatform.Mac:
|
|
case UnrealTargetPlatform.IOS:
|
|
case UnrealTargetPlatform.TVOS:
|
|
{
|
|
UnrealBuildTool.DirectoryReference CMakeTargetDirectory = GetProjectDirectory(TargetLib, TargetData);
|
|
MakeFreshDirectoryIfRequired(CMakeTargetDirectory);
|
|
|
|
if (!bCleanOnly)
|
|
{
|
|
Log("Generating projects for lib " + TargetLib.ToString() + ", " + TargetData.ToString());
|
|
|
|
ProcessStartInfo StartInfo = new ProcessStartInfo();
|
|
StartInfo.FileName = CMakeName;
|
|
StartInfo.WorkingDirectory = CMakeTargetDirectory.ToString();
|
|
StartInfo.Arguments = GetCMakeArguments(TargetLib, TargetData);
|
|
|
|
RunLocalProcessAndLogOutput(StartInfo);
|
|
}
|
|
}
|
|
break;
|
|
case UnrealTargetPlatform.HTML5:
|
|
// NOTE: HTML5 does not do "debug" - the full text blows out memory
|
|
// instead, HTML5 builds have 4 levels of optimizations
|
|
// so, MAP BuildConfig to HTML5 optimization levels
|
|
Dictionary<string, string> BuildMap = new Dictionary<string, string>()
|
|
{
|
|
{"debug", "-O0"},
|
|
{"checked", "-O2"},
|
|
{"profile", "-Oz"},
|
|
{"release", "-O3"}
|
|
};
|
|
UnrealBuildTool.DirectoryReference HTML5CMakeModules = DirectoryReference.Combine(PhysXSourceRootDirectory, "Externals", "CMakeModules", "HTML5");
|
|
MakeFreshDirectoryIfRequired(HTML5CMakeModules);
|
|
|
|
foreach(string BuildConfig in TargetConfigurations)
|
|
{
|
|
UnrealBuildTool.DirectoryReference CMakeTargetDirectory = GetProjectDirectory(TargetLib, TargetData);
|
|
CMakeTargetDirectory = UnrealBuildTool.DirectoryReference.Combine(CMakeTargetDirectory, "BUILD" + BuildMap[BuildConfig]);
|
|
MakeFreshDirectoryIfRequired(CMakeTargetDirectory);
|
|
|
|
if (!bCleanOnly)
|
|
{
|
|
Log("Generating projects for lib " + TargetLib.ToString() + ", " + TargetData.ToString());
|
|
|
|
// CMAKE_TOOLCHAIN_FILE
|
|
Environment.SetEnvironmentVariable("LIB_SUFFIX", GetConfigurationSuffix(BuildConfig, TargetData)); // only used in HTML5's CMakefiles
|
|
|
|
string orig = File.ReadAllText(HTML5SDKInfo.EmscriptenCMakeToolChainFile);
|
|
string txt = Regex.Replace(orig, "(EPIC_BUILD_FLAGS}) .*-O2" , "$1 " + BuildMap[BuildConfig] );
|
|
string CmakeToolchainFile = FileReference.Combine(HTML5CMakeModules, "Emscripten." + BuildConfig + ".cmake").ToString();
|
|
File.WriteAllText(CmakeToolchainFile, txt);
|
|
|
|
// ----------------------------------------
|
|
|
|
// CMAKE
|
|
ProcessStartInfo StartInfo = new ProcessStartInfo();
|
|
StartInfo.FileName = "cmake";
|
|
StartInfo.WorkingDirectory = CMakeTargetDirectory.ToString();
|
|
StartInfo.Arguments = GetCMakeArguments(TargetLib, TargetData, BuildConfig);
|
|
|
|
Log("Working in: {0}", StartInfo.WorkingDirectory);
|
|
Log("{0} {1}", StartInfo.FileName, StartInfo.Arguments);
|
|
|
|
if (RunLocalProcessAndLogOutput(StartInfo) != 0)
|
|
{
|
|
throw new AutomationException(String.Format("Unabled to generate projects for {0}.", TargetLib.ToString() + ", " + TargetData.ToString()));
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
default:
|
|
{
|
|
UnrealBuildTool.DirectoryReference CMakeTargetDirectory = GetProjectDirectory(TargetLib, TargetData);
|
|
MakeFreshDirectoryIfRequired(CMakeTargetDirectory);
|
|
|
|
if (!bCleanOnly)
|
|
{
|
|
Log("Generating projects for lib " + TargetLib.ToString() + ", " + TargetData.ToString());
|
|
|
|
ProcessStartInfo StartInfo = new ProcessStartInfo();
|
|
StartInfo.FileName = CMakeName;
|
|
StartInfo.WorkingDirectory = CMakeTargetDirectory.ToString();
|
|
StartInfo.Arguments = GetCMakeArguments(TargetLib, TargetData);
|
|
|
|
RunLocalProcessAndLogOutput(StartInfo);
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
private static string GetMsDevExe(WindowsCompiler Version)
|
|
{
|
|
DirectoryReference VSPath;
|
|
// It's not fatal if VS2013 isn't installed for VS2015 builds (for example, so don't crash here)
|
|
if(WindowsExports.TryGetVSInstallDir(Version, out VSPath))
|
|
{
|
|
return FileReference.Combine(VSPath, "Common7", "IDE", "Devenv.com").FullName;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
private static string GetMsBuildExe(WindowsCompiler Version)
|
|
{
|
|
string VisualStudioToolchainVersion = "";
|
|
switch (Version)
|
|
{
|
|
case WindowsCompiler.VisualStudio2013:
|
|
VisualStudioToolchainVersion = "12.0";
|
|
break;
|
|
case WindowsCompiler.VisualStudio2015:
|
|
VisualStudioToolchainVersion = "14.0";
|
|
break;
|
|
}
|
|
string ProgramFilesPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);
|
|
string MSBuildPath = Path.Combine(ProgramFilesPath, "MSBuild", VisualStudioToolchainVersion, "Bin", "MSBuild.exe");
|
|
if (File.Exists(MSBuildPath))
|
|
{
|
|
return MSBuildPath;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
private static string RemoveOtherMakeFromPath(string WindowsPath)
|
|
{
|
|
string[] PathComponents = WindowsPath.Split(';');
|
|
string NewPath = "";
|
|
foreach(string PathComponent in PathComponents)
|
|
{
|
|
// everything what contains /bin or /sbin is suspicious, check if it has make in it
|
|
if (PathComponent.Contains("\\bin") || PathComponent.Contains("/bin") || PathComponent.Contains("\\sbin") || PathComponent.Contains("/sbin"))
|
|
{
|
|
if (File.Exists(PathComponent + "/make.exe") || File.Exists(PathComponent + "make.exe"))
|
|
{
|
|
// gotcha!
|
|
Log("Removing {0} from PATH since it contains possibly colliding make.exe", PathComponent);
|
|
continue;
|
|
}
|
|
}
|
|
|
|
NewPath = NewPath + ';' + PathComponent + ';';
|
|
}
|
|
|
|
return NewPath;
|
|
}
|
|
private static void SetupBuildEnvironment()
|
|
{
|
|
if (!Utils.IsRunningOnMono)
|
|
{
|
|
string VS2015Path = GetMsDevExe(WindowsCompiler.VisualStudio2015);
|
|
if (VS2015Path != null)
|
|
{
|
|
MsDev14Exe = new UnrealBuildTool.FileReference(GetMsDevExe(WindowsCompiler.VisualStudio2015));
|
|
MsBuildExe = new UnrealBuildTool.FileReference(GetMsBuildExe(WindowsCompiler.VisualStudio2015));
|
|
}
|
|
|
|
// ================================================================================
|
|
// ThirdPartyNotUE
|
|
// NOTE: these are Windows executables
|
|
if (BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Win64)
|
|
{
|
|
DirectoryReference ThirdPartyNotUERootDirectory = DirectoryReference.Combine(CommandUtils.RootDirectory, "Engine", "Extras", "ThirdPartyNotUE");
|
|
string CMakePath = DirectoryReference.Combine(ThirdPartyNotUERootDirectory, "CMake", "bin").ToString();
|
|
string MakePath = DirectoryReference.Combine(ThirdPartyNotUERootDirectory, "GNU_Make", "make-3.81", "bin").ToString();
|
|
|
|
string PrevPath = Environment.GetEnvironmentVariable("PATH");
|
|
// mixing bundled make and cygwin make is no good. Try to detect and remove cygwin paths.
|
|
string PathWithoutCygwin = RemoveOtherMakeFromPath(PrevPath);
|
|
Environment.SetEnvironmentVariable("PATH", CMakePath + ";" + MakePath + ";" + PathWithoutCygwin);
|
|
Environment.SetEnvironmentVariable("PATH", CMakePath + ";" + MakePath + ";" + Environment.GetEnvironmentVariable("PATH"));
|
|
Log("set {0}={1}", "PATH", Environment.GetEnvironmentVariable("PATH"));
|
|
}
|
|
// ================================================================================
|
|
// HTML5
|
|
// FIXME: only run this if GetTargetPlatforms() contains HTML5
|
|
|
|
// override BuildConfiguration defaults - so we can use HTML5SDKInfo
|
|
string EngineSourceDir = GetProjectDirectory(PhysXTargetLib.PhysX, new TargetPlatformData(UnrealTargetPlatform.HTML5)).ToString();
|
|
EngineSourceDir = Regex.Replace(EngineSourceDir, @"\\" , "/");
|
|
EngineSourceDir = Regex.Replace(EngineSourceDir, ".*Engine/" , "");
|
|
|
|
if (!HTML5SDKInfo.IsSDKInstalled())
|
|
{
|
|
throw new AutomationException("EMSCRIPTEN SDK TOOLCHAIN NOT FOUND...");
|
|
}
|
|
// warm up emscripten config file
|
|
HTML5SDKInfo.SetUpEmscriptenConfigFile();
|
|
Environment.SetEnvironmentVariable("PATH",
|
|
Environment.GetEnvironmentVariable("EMSCRIPTEN") + ";" +
|
|
Environment.GetEnvironmentVariable("NODEPATH") + ";" +
|
|
Environment.GetEnvironmentVariable("LLVM") + ";" +
|
|
Path.GetDirectoryName(HTML5SDKInfo.Python()) + ";" +
|
|
Environment.GetEnvironmentVariable("PATH"));
|
|
//Log("set {0}={1}", "PATH", Environment.GetEnvironmentVariable("PATH"));
|
|
}
|
|
}
|
|
|
|
private static void BuildMSBuildTarget(PhysXTargetLib TargetLib, TargetPlatformData TargetData, List<string> TargetConfigurations, WindowsCompiler TargetWindowsCompiler = WindowsCompiler.VisualStudio2015)
|
|
{
|
|
string SolutionFile = GetTargetLibSolutionFileName(TargetLib, TargetData, TargetWindowsCompiler).ToString();
|
|
string MSDevExe = GetMsDevExe(TargetData);
|
|
|
|
if (!FileExists(SolutionFile))
|
|
{
|
|
throw new AutomationException(String.Format("Unabled to build Solution {0}. Solution file not found.", SolutionFile));
|
|
}
|
|
if (String.IsNullOrEmpty(MSDevExe))
|
|
{
|
|
throw new AutomationException(String.Format("Unabled to build Solution {0}. devenv.com not found.", SolutionFile));
|
|
}
|
|
|
|
foreach (string BuildConfig in TargetConfigurations)
|
|
{
|
|
string CmdLine = String.Format("\"{0}\" /build \"{1}\"", SolutionFile, BuildConfig);
|
|
RunAndLog(BuildCommand.CmdEnv, MSDevExe, CmdLine);
|
|
}
|
|
}
|
|
|
|
private static void BuildXboxTarget(PhysXTargetLib TargetLib, TargetPlatformData TargetData, List<string> TargetConfigurations, WindowsCompiler TargetWindowsCompiler = WindowsCompiler.VisualStudio2015)
|
|
{
|
|
if (TargetData.Platform != UnrealTargetPlatform.XboxOne)
|
|
{
|
|
return;
|
|
}
|
|
|
|
string SolutionFile = GetTargetLibSolutionFileName(TargetLib, TargetData, TargetWindowsCompiler).ToString();
|
|
string MSBuildExe = GetMsBuildExe(TargetData);
|
|
|
|
if (!FileExists(SolutionFile))
|
|
{
|
|
throw new AutomationException(String.Format("Unabled to build Solution {0}. Solution file not found.", SolutionFile));
|
|
}
|
|
if (String.IsNullOrEmpty(MSBuildExe))
|
|
{
|
|
throw new AutomationException(String.Format("Unabled to build Solution {0}. msbuild.exe not found.", SolutionFile));
|
|
}
|
|
|
|
string AdditionalProperties = "";
|
|
string AutoSDKPropsPath = Environment.GetEnvironmentVariable("XboxOneAutoSDKProp");
|
|
if (AutoSDKPropsPath != null && AutoSDKPropsPath.Length > 0)
|
|
{
|
|
AdditionalProperties += String.Format(";CustomBeforeMicrosoftCommonProps={0}", AutoSDKPropsPath);
|
|
}
|
|
string XboxCMakeModulesPath = Path.Combine(PhysXSourceRootDirectory.FullName, "Externals", "CMakeModules", "XboxOne", "Microsoft.Cpp.Durango.user.props");
|
|
if (File.Exists(XboxCMakeModulesPath))
|
|
{
|
|
AdditionalProperties += String.Format(";ForceImportBeforeCppTargets={0}", XboxCMakeModulesPath);
|
|
}
|
|
|
|
foreach (string BuildConfig in TargetConfigurations)
|
|
{
|
|
string CmdLine = String.Format("\"{0}\" /t:build /p:Configuration={1};Platform=Durango{2}", SolutionFile, BuildConfig, AdditionalProperties);
|
|
RunAndLog(BuildCommand.CmdEnv, MSBuildExe, CmdLine);
|
|
}
|
|
}
|
|
|
|
private static void BuildMakefileTarget(PhysXTargetLib TargetLib, TargetPlatformData TargetData, List<string> TargetConfigurations)
|
|
{
|
|
// FIXME: use absolute path
|
|
string MakeCommand = "make";
|
|
|
|
// FIXME: "j -16" should be tweakable
|
|
//string MakeOptions = "-j 1";
|
|
string MakeOptions = "-j 16";
|
|
|
|
// Bundled GNU make does not pass job number to subprocesses on Windows, work around that...
|
|
if (BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Win64)
|
|
{
|
|
// Redefining the MAKE variable will cause the -j flag to be passed to child make instances.
|
|
MakeOptions = string.Format("{1} \"MAKE={0} {1}\"", MakeCommand, MakeOptions);
|
|
}
|
|
|
|
// this will be replaced for HTML5 - see SetupBuildForTargetLibAndPlatform() for details
|
|
Dictionary<string, string> BuildMap = new Dictionary<string, string>()
|
|
{
|
|
{"debug", "debug"},
|
|
{"checked", "checked"},
|
|
{"profile", "profile"},
|
|
{"release", "release"}
|
|
};
|
|
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Android:
|
|
{
|
|
// Use make from Android toolchain
|
|
string NDKDirectory = Environment.GetEnvironmentVariable("NDKROOT");
|
|
|
|
// don't register if we don't have an NDKROOT specified
|
|
if (String.IsNullOrEmpty(NDKDirectory))
|
|
{
|
|
throw new BuildException("NDKROOT is not specified; cannot build Android.");
|
|
}
|
|
|
|
NDKDirectory = NDKDirectory.Replace("\"", "");
|
|
|
|
MakeCommand = NDKDirectory + "\\prebuilt\\windows-x86_64\\bin\\make.exe";
|
|
}
|
|
break;
|
|
case UnrealTargetPlatform.HTML5:
|
|
{
|
|
// Use emscripten toolchain
|
|
MakeCommand = "python";
|
|
MakeOptions = HTML5SDKInfo.EMSCRIPTEN_ROOT + "\\emmake make";
|
|
BuildMap = new Dictionary<string, string>()
|
|
{
|
|
{"debug", "Build-O0"},
|
|
{"checked", "Build-O2"},
|
|
{"profile", "Build-Oz"},
|
|
{"release", "Build-O3"}
|
|
};
|
|
}
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
// makefile build has "projects" for every configuration. However, we abstract away from that by assuming GetProjectDirectory points to the "meta-project"
|
|
foreach (string BuildConfig in TargetConfigurations)
|
|
{
|
|
UnrealBuildTool.DirectoryReference MetaProjectDirectory = GetProjectDirectory(TargetLib, TargetData);
|
|
UnrealBuildTool.DirectoryReference ConfigDirectory = UnrealBuildTool.DirectoryReference.Combine(MetaProjectDirectory, BuildMap[BuildConfig]);
|
|
Environment.SetEnvironmentVariable("LIB_SUFFIX", GetConfigurationSuffix(BuildConfig, TargetData)); // only used in HTML5's CMakefiles
|
|
string Makefile = UnrealBuildTool.FileReference.Combine(ConfigDirectory, "Makefile").ToString();
|
|
if (!FileExists(Makefile))
|
|
{
|
|
throw new AutomationException(String.Format("Unabled to build {0} - file not found.", Makefile));
|
|
}
|
|
|
|
ProcessStartInfo StartInfo = new ProcessStartInfo();
|
|
StartInfo.FileName = MakeCommand;
|
|
StartInfo.WorkingDirectory = ConfigDirectory.ToString();
|
|
StartInfo.Arguments = MakeOptions;
|
|
|
|
Log("Working in: {0}", StartInfo.WorkingDirectory);
|
|
Log("{0} {1}", StartInfo.FileName, StartInfo.Arguments);
|
|
|
|
if (RunLocalProcessAndLogOutput(StartInfo) != 0)
|
|
{
|
|
throw new AutomationException(String.Format("Unabled to build {0}. Build process failed.", Makefile));
|
|
}
|
|
}
|
|
}
|
|
|
|
private static void BuildXcodeTarget(PhysXTargetLib TargetLib, TargetPlatformData TargetData, List<string> TargetConfigurations)
|
|
{
|
|
UnrealBuildTool.DirectoryReference Directory = GetProjectDirectory(TargetLib, TargetData);
|
|
string ProjectName = "";
|
|
|
|
switch(TargetLib)
|
|
{
|
|
case PhysXTargetLib.APEX:
|
|
ProjectName = "APEX";
|
|
break;
|
|
case PhysXTargetLib.NvCloth:
|
|
ProjectName = "NvCloth";
|
|
break;
|
|
case PhysXTargetLib.PhysX:
|
|
ProjectName = "PhysX";
|
|
break;
|
|
default:
|
|
throw new AutomationException(String.Format("Unabled to build XCode target, Unsupported library {0}.", TargetLib.ToString()));
|
|
}
|
|
|
|
string ProjectFile = UnrealBuildTool.FileReference.Combine(Directory, ProjectName + ".xcodeproj").ToString();
|
|
|
|
if (!DirectoryExists(ProjectFile))
|
|
{
|
|
throw new AutomationException(String.Format("Unabled to build project {0}. Project file not found.", ProjectFile));
|
|
}
|
|
|
|
foreach (string BuildConfig in TargetConfigurations)
|
|
{
|
|
string CmdLine = String.Format("-project \"{0}\" -target=\"ALL_BUILD\" -configuration {1}", ProjectFile, BuildConfig);
|
|
RunAndLog(BuildCommand.CmdEnv, "/usr/bin/xcodebuild", CmdLine);
|
|
}
|
|
}
|
|
|
|
private static void BuildTargetLibForPlatform(PhysXTargetLib TargetLib, TargetPlatformData TargetData, List<string> TargetConfigurations, List<WindowsCompiler> TargetWindowsCompilers)
|
|
{
|
|
if (DoesPlatformUseMSBuild(TargetData))
|
|
{
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Win32:
|
|
case UnrealTargetPlatform.Win64:
|
|
// for windows platforms we support building against multiple compilers
|
|
foreach (WindowsCompiler TargetWindowsCompiler in TargetWindowsCompilers)
|
|
{
|
|
BuildMSBuildTarget(TargetLib, TargetData, TargetConfigurations, TargetWindowsCompiler);
|
|
}
|
|
break;
|
|
case UnrealTargetPlatform.XboxOne:
|
|
BuildXboxTarget(TargetLib, TargetData, TargetConfigurations);
|
|
break;
|
|
default:
|
|
BuildMSBuildTarget(TargetLib, TargetData, TargetConfigurations);
|
|
break;
|
|
}
|
|
}
|
|
else if (DoesPlatformUseXcode(TargetData))
|
|
{
|
|
BuildXcodeTarget(TargetLib, TargetData, TargetConfigurations);
|
|
}
|
|
else if (DoesPlatformUseMakefiles(TargetData))
|
|
{
|
|
BuildMakefileTarget(TargetLib, TargetData, TargetConfigurations);
|
|
}
|
|
else
|
|
{
|
|
throw new AutomationException(String.Format("Unsupported target platform '{0}' passed to BuildTargetLibForPlatform", TargetData));
|
|
}
|
|
}
|
|
|
|
private static DirectoryReference GetPlatformBinaryDirectory(TargetPlatformData TargetData, WindowsCompiler TargetWindowsCompiler)
|
|
{
|
|
string VisualStudioName = string.Empty;
|
|
string ArchName = string.Empty;
|
|
|
|
if (DoesPlatformUseMSBuild(TargetData))
|
|
{
|
|
switch (TargetWindowsCompiler)
|
|
{
|
|
case WindowsCompiler.VisualStudio2013:
|
|
VisualStudioName = "VS2013";
|
|
break;
|
|
case WindowsCompiler.VisualStudio2015:
|
|
VisualStudioName = "VS2015";
|
|
break;
|
|
default:
|
|
throw new AutomationException(String.Format("Unsupported visual studio compiler '{0}' supplied to GetOutputBinaryDirectory", TargetWindowsCompiler));
|
|
}
|
|
}
|
|
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Win32:
|
|
ArchName = "Win32";
|
|
break;
|
|
case UnrealTargetPlatform.Win64:
|
|
ArchName = "Win64";
|
|
break;
|
|
case UnrealTargetPlatform.Mac:
|
|
ArchName = "Mac";
|
|
break;
|
|
default:
|
|
throw new AutomationException(String.Format("Unsupported platform '{0}' supplied to GetOutputBinaryDirectory", TargetData.ToString()));
|
|
}
|
|
|
|
return UnrealBuildTool.DirectoryReference.Combine(RootOutputBinaryDirectory, ArchName, VisualStudioName);
|
|
}
|
|
|
|
private static DirectoryReference GetPlatformLibDirectory(TargetPlatformData TargetData, WindowsCompiler TargetWindowsCompiler)
|
|
{
|
|
string VisualStudioName = string.Empty;
|
|
string ArchName = string.Empty;
|
|
|
|
if (DoesPlatformUseMSBuild(TargetData))
|
|
{
|
|
switch (TargetWindowsCompiler)
|
|
{
|
|
case WindowsCompiler.VisualStudio2013:
|
|
VisualStudioName = "VS2013";
|
|
break;
|
|
case WindowsCompiler.VisualStudio2015:
|
|
VisualStudioName = "VS2015";
|
|
break;
|
|
default:
|
|
throw new AutomationException(String.Format("Unsupported visual studio compiler '{0}' supplied to GetOutputLibDirectory", TargetWindowsCompiler));
|
|
}
|
|
}
|
|
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Win32:
|
|
ArchName = "Win32";
|
|
break;
|
|
case UnrealTargetPlatform.Win64:
|
|
ArchName = "Win64";
|
|
break;
|
|
case UnrealTargetPlatform.XboxOne:
|
|
ArchName = "XboxOne";
|
|
break;
|
|
case UnrealTargetPlatform.PS4:
|
|
ArchName = "PS4";
|
|
break;
|
|
case UnrealTargetPlatform.Switch:
|
|
ArchName = "Switch";
|
|
break;
|
|
case UnrealTargetPlatform.Android:
|
|
switch (TargetData.Architecture)
|
|
{
|
|
default:
|
|
case "arm7": ArchName = "Android/ARMv7"; break;
|
|
case "arm64": ArchName = "Android/ARM64"; break;
|
|
case "x86": ArchName = "Android/x86"; break;
|
|
case "x64": ArchName = "Android/x64"; break;
|
|
}
|
|
break;
|
|
case UnrealTargetPlatform.Linux:
|
|
ArchName = "Linux/" + TargetData.Architecture;
|
|
break;
|
|
case UnrealTargetPlatform.Mac:
|
|
ArchName = "Mac";
|
|
break;
|
|
case UnrealTargetPlatform.HTML5:
|
|
ArchName = "HTML5";
|
|
break;
|
|
case UnrealTargetPlatform.IOS:
|
|
ArchName = "IOS";
|
|
break;
|
|
case UnrealTargetPlatform.TVOS:
|
|
ArchName = "TVOS";
|
|
break;
|
|
default:
|
|
throw new AutomationException(String.Format("Unsupported platform '{0}' supplied to GetOutputLibDirectory", TargetData.ToString()));
|
|
}
|
|
|
|
return UnrealBuildTool.DirectoryReference.Combine(RootOutputLibDirectory, ArchName, VisualStudioName);
|
|
}
|
|
|
|
private static bool PlatformHasBinaries(TargetPlatformData TargetData)
|
|
{
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Win32:
|
|
case UnrealTargetPlatform.Win64:
|
|
case UnrealTargetPlatform.Mac:
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
private static bool PlatformUsesDebugDatabase(TargetPlatformData TargetData)
|
|
{
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Win32:
|
|
case UnrealTargetPlatform.Win64:
|
|
// case UnrealTargetPlatform.Mac:
|
|
case UnrealTargetPlatform.XboxOne:
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
private static string GetPlatformDebugDatabaseExtension(TargetPlatformData TargetData)
|
|
{
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Win32:
|
|
case UnrealTargetPlatform.Win64:
|
|
case UnrealTargetPlatform.XboxOne:
|
|
return "pdb";
|
|
case UnrealTargetPlatform.Mac:
|
|
return "dSYM";
|
|
}
|
|
throw new AutomationException(String.Format("No debug database extension for platform ", TargetData.Platform.ToString()));
|
|
}
|
|
|
|
private static string GetPlatformBinaryExtension(TargetPlatformData TargetData)
|
|
{
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Win32:
|
|
case UnrealTargetPlatform.Win64:
|
|
return "dll";
|
|
case UnrealTargetPlatform.Mac:
|
|
return "dylib";
|
|
}
|
|
throw new AutomationException(String.Format("No binary extension for platform ", TargetData.Platform.ToString()));
|
|
}
|
|
|
|
private static string GetPlatformLibExtension(TargetPlatformData TargetData)
|
|
{
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Win32:
|
|
case UnrealTargetPlatform.Win64:
|
|
case UnrealTargetPlatform.XboxOne:
|
|
return "lib";
|
|
case UnrealTargetPlatform.PS4:
|
|
case UnrealTargetPlatform.Android:
|
|
case UnrealTargetPlatform.Linux:
|
|
case UnrealTargetPlatform.Mac:
|
|
case UnrealTargetPlatform.IOS:
|
|
case UnrealTargetPlatform.TVOS:
|
|
case UnrealTargetPlatform.Switch:
|
|
return "a";
|
|
case UnrealTargetPlatform.HTML5:
|
|
return "bc";
|
|
}
|
|
throw new AutomationException(String.Format("No lib extension for platform ", TargetData.Platform.ToString()));
|
|
}
|
|
|
|
private static bool FileGeneratedByLib(string FileNameUpper, PhysXTargetLib TargetLib)
|
|
{
|
|
switch(TargetLib)
|
|
{
|
|
case PhysXTargetLib.APEX:
|
|
return FileGeneratedByAPEX(FileNameUpper);
|
|
case PhysXTargetLib.NvCloth:
|
|
return FileGeneratedByNvCloth(FileNameUpper);
|
|
default:
|
|
break;
|
|
}
|
|
|
|
// Must have been PhysX if we got here, if it wasn't generated by other libs, then it's PhysX
|
|
return !FileGeneratedByAPEX(FileNameUpper) && !FileGeneratedByNvCloth(FileNameUpper);
|
|
}
|
|
|
|
private static bool FileGeneratedByNvCloth(string FileNameUpper)
|
|
{
|
|
if(FileNameUpper.StartsWith("NVCLOTH"))
|
|
{
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
private static bool FileGeneratedByAPEX(string FileNameUpper)
|
|
{
|
|
if (FileNameUpper.StartsWith("APEX"))
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
foreach (string SpecialApexLib in APEXSpecialLibs)
|
|
{
|
|
if (FileNameUpper.StartsWith(SpecialApexLib.ToUpper())) //There are some APEX libs that don't use the APEX prefix so make sure to test against it
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
private static void FindOutputFilesHelper(HashSet<FileReference> OutputFiles, DirectoryReference BaseDir, string SearchPrefix, PhysXTargetLib TargetLib)
|
|
{
|
|
if(!DirectoryReference.Exists(BaseDir))
|
|
{
|
|
return;
|
|
}
|
|
|
|
foreach (FileReference FoundFile in DirectoryReference.EnumerateFiles(BaseDir, SearchPrefix))
|
|
{
|
|
string FileNameUpper = FoundFile.GetFileName().ToString().ToUpper();
|
|
|
|
if(FileGeneratedByLib(FileNameUpper, TargetLib))
|
|
{
|
|
OutputFiles.Add(FoundFile);
|
|
}
|
|
}
|
|
}
|
|
|
|
private static string GetConfigurationSuffix(string TargetConfiguration, TargetPlatformData TargetData)
|
|
{
|
|
// default
|
|
Dictionary<string, string> BuildSuffix = new Dictionary<string, string>()
|
|
{
|
|
{"debug", "debug"},
|
|
{"checked", "checked"},
|
|
{"profile", "profile"},
|
|
{"release", ""}
|
|
};
|
|
|
|
if (TargetData.Platform == UnrealTargetPlatform.HTML5)
|
|
{
|
|
// HTML5 - see SetupBuildForTargetLibAndPlatform() for details
|
|
BuildSuffix = new Dictionary<string, string>()
|
|
{
|
|
{"debug", ""},
|
|
{"checked", "_O2"},
|
|
{"profile", "_Oz"},
|
|
{"release", "_O3"}
|
|
};
|
|
}
|
|
|
|
return BuildSuffix[TargetConfiguration];
|
|
}
|
|
|
|
private static void FindOutputFiles(HashSet<FileReference> OutputFiles, PhysXTargetLib TargetLib, TargetPlatformData TargetData, string TargetConfiguration, WindowsCompiler TargetWindowsCompiler = WindowsCompiler.VisualStudio2015)
|
|
{
|
|
string SearchSuffix = GetConfigurationSuffix(TargetConfiguration, TargetData).ToUpper();
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Win32:
|
|
SearchSuffix += "_x86";
|
|
break;
|
|
case UnrealTargetPlatform.Win64:
|
|
SearchSuffix += "_x64";
|
|
break;
|
|
}
|
|
string SearchPrefix = "*" + SearchSuffix + ".";
|
|
|
|
string DebugExtension = PlatformUsesDebugDatabase(TargetData) ? GetPlatformDebugDatabaseExtension(TargetData) : "";
|
|
|
|
if (PlatformHasBinaries(TargetData))
|
|
{
|
|
DirectoryReference BinaryDir = GetPlatformBinaryDirectory(TargetData, TargetWindowsCompiler);
|
|
FindOutputFilesHelper(OutputFiles, BinaryDir, SearchPrefix + GetPlatformBinaryExtension(TargetData), TargetLib);
|
|
|
|
if (PlatformUsesDebugDatabase(TargetData))
|
|
{
|
|
FindOutputFilesHelper(OutputFiles, BinaryDir, SearchPrefix + DebugExtension, TargetLib);
|
|
}
|
|
}
|
|
|
|
DirectoryReference LibDir = GetPlatformLibDirectory(TargetData, TargetWindowsCompiler);
|
|
FindOutputFilesHelper(OutputFiles, LibDir, SearchPrefix + GetPlatformLibExtension(TargetData), TargetLib);
|
|
|
|
if (PlatformUsesDebugDatabase(TargetData))
|
|
{
|
|
FindOutputFilesHelper(OutputFiles, LibDir, SearchPrefix + DebugExtension, TargetLib);
|
|
}
|
|
}
|
|
|
|
private static bool PlatformSupportsTargetLib(PhysXTargetLib TargetLib, TargetPlatformData TargetData)
|
|
{
|
|
if(TargetLib == PhysXTargetLib.APEX)
|
|
{
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Win32:
|
|
case UnrealTargetPlatform.Win64:
|
|
case UnrealTargetPlatform.PS4:
|
|
case UnrealTargetPlatform.XboxOne:
|
|
case UnrealTargetPlatform.Mac:
|
|
case UnrealTargetPlatform.Switch:
|
|
return true;
|
|
case UnrealTargetPlatform.Linux:
|
|
// only x86_64 Linux supports it.
|
|
return TargetData.Architecture.StartsWith("x86_64");
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
|
|
if(TargetLib == PhysXTargetLib.NvCloth)
|
|
{
|
|
switch(TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Win32:
|
|
case UnrealTargetPlatform.Win64:
|
|
case UnrealTargetPlatform.PS4:
|
|
case UnrealTargetPlatform.XboxOne:
|
|
case UnrealTargetPlatform.Mac:
|
|
return true;
|
|
case UnrealTargetPlatform.Linux:
|
|
// only x86_64 Linux supports it.
|
|
return TargetData.Architecture.StartsWith("x86_64");
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public override void ExecuteBuild()
|
|
{
|
|
SetupBuildEnvironment();
|
|
|
|
bool bBuildSolutions = true;
|
|
if (ParseParam("SkipBuildSolutions"))
|
|
{
|
|
bBuildSolutions = false;
|
|
}
|
|
|
|
bool bBuildLibraries = true;
|
|
if (ParseParam("SkipBuild"))
|
|
{
|
|
bBuildLibraries = false;
|
|
}
|
|
|
|
bool bAutoCreateChangelist = true;
|
|
if (ParseParam("SkipCreateChangelist"))
|
|
{
|
|
bAutoCreateChangelist = false;
|
|
}
|
|
|
|
bool bAutoSubmit = bAutoCreateChangelist;
|
|
if (ParseParam("SkipSubmit"))
|
|
{
|
|
bAutoSubmit = false;
|
|
}
|
|
|
|
// Parse out the libs we want to build
|
|
List<PhysXTargetLib> TargetLibs = GetTargetLibs();
|
|
|
|
// get the platforms we want to build for
|
|
List<TargetPlatformData> TargetPlatforms = GetTargetPlatforms();
|
|
|
|
// get the platforms we want to build for
|
|
List<WindowsCompiler> TargetWindowsCompilers = GetTargetWindowsCompilers();
|
|
|
|
// get the configurations we want to build for
|
|
List<string> TargetConfigurations = GetTargetConfigurations();
|
|
|
|
if (bBuildSolutions)
|
|
{
|
|
foreach (PhysXTargetLib TargetLib in TargetLibs)
|
|
{
|
|
// build target lib for all platforms
|
|
foreach (TargetPlatformData TargetData in TargetPlatforms)
|
|
{
|
|
if (!PlatformSupportsTargetLib(TargetLib, TargetData))
|
|
{
|
|
continue;
|
|
}
|
|
|
|
SetupBuildForTargetLibAndPlatform(TargetLib, TargetData, TargetConfigurations, TargetWindowsCompilers, false);
|
|
}
|
|
}
|
|
}
|
|
|
|
HashSet<FileReference> FilesToReconcile = new HashSet<FileReference>();
|
|
if (bBuildLibraries)
|
|
{
|
|
foreach (PhysXTargetLib TargetLib in TargetLibs)
|
|
{
|
|
// build target lib for all platforms
|
|
foreach (TargetPlatformData TargetData in TargetPlatforms)
|
|
{
|
|
if(!PlatformSupportsTargetLib(TargetLib, TargetData))
|
|
{
|
|
continue;
|
|
}
|
|
|
|
HashSet<FileReference> FilesToDelete = new HashSet<FileReference>();
|
|
foreach (string TargetConfiguration in TargetConfigurations)
|
|
{
|
|
// Delete output files before building them
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Win32:
|
|
case UnrealTargetPlatform.Win64:
|
|
foreach (WindowsCompiler TargetCompiler in TargetWindowsCompilers)
|
|
{
|
|
FindOutputFiles(FilesToDelete, TargetLib, TargetData, TargetConfiguration, TargetCompiler);
|
|
}
|
|
break;
|
|
default:
|
|
FindOutputFiles(FilesToDelete, TargetLib, TargetData, TargetConfiguration);
|
|
break;
|
|
}
|
|
}
|
|
|
|
foreach(FileReference FileToDelete in FilesToDelete)
|
|
{
|
|
FilesToReconcile.Add(FileToDelete);
|
|
InternalUtils.SafeDeleteFile(FileToDelete.ToString());
|
|
}
|
|
|
|
BuildTargetLibForPlatform(TargetLib, TargetData, TargetConfigurations, TargetWindowsCompilers);
|
|
}
|
|
}
|
|
}
|
|
|
|
int P4ChangeList = InvalidChangeList;
|
|
if (bAutoCreateChangelist)
|
|
{
|
|
string LibDeploymentDesc = "";
|
|
|
|
foreach(PhysXTargetLib Lib in TargetLibs)
|
|
{
|
|
if(LibDeploymentDesc.Length != 0)
|
|
{
|
|
LibDeploymentDesc += " & ";
|
|
}
|
|
|
|
LibDeploymentDesc += Lib.ToString();
|
|
}
|
|
|
|
foreach (TargetPlatformData TargetData in TargetPlatforms)
|
|
{
|
|
LibDeploymentDesc += " " + TargetData.ToString();
|
|
}
|
|
|
|
P4ChangeList = P4.CreateChange(P4Env.Client, String.Format("BuildPhysX.Automation: Deploying {0} libs.", LibDeploymentDesc) + Environment.NewLine + "#rb none" + Environment.NewLine + "#lockdown Nick.Penwarden" + Environment.NewLine + "#tests none");
|
|
}
|
|
|
|
|
|
if (P4ChangeList != InvalidChangeList)
|
|
{
|
|
foreach (PhysXTargetLib TargetLib in TargetLibs)
|
|
{
|
|
foreach (string TargetConfiguration in TargetConfigurations)
|
|
{
|
|
//Add any new files that p4 is not yet tracking.
|
|
foreach (TargetPlatformData TargetData in TargetPlatforms)
|
|
{
|
|
if (!PlatformSupportsTargetLib(TargetLib, TargetData))
|
|
{
|
|
continue;
|
|
}
|
|
|
|
|
|
switch (TargetData.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Win32:
|
|
case UnrealTargetPlatform.Win64:
|
|
foreach (WindowsCompiler TargetCompiler in TargetWindowsCompilers)
|
|
{
|
|
FindOutputFiles(FilesToReconcile, TargetLib, TargetData, TargetConfiguration, TargetCompiler);
|
|
}
|
|
break;
|
|
default:
|
|
FindOutputFiles(FilesToReconcile, TargetLib, TargetData, TargetConfiguration);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
foreach(FileReference FileToReconcile in FilesToReconcile)
|
|
{
|
|
P4.Reconcile(P4ChangeList, FileToReconcile.ToString());
|
|
}
|
|
}
|
|
|
|
if(bAutoSubmit && (P4ChangeList != InvalidChangeList))
|
|
{
|
|
if (!P4.TryDeleteEmptyChange(P4ChangeList))
|
|
{
|
|
Log("Submitting changelist " + P4ChangeList.ToString());
|
|
int SubmittedChangeList = InvalidChangeList;
|
|
P4.Submit(P4ChangeList, out SubmittedChangeList);
|
|
}
|
|
else
|
|
{
|
|
Log("Nothing to submit!");
|
|
}
|
|
}
|
|
}
|
|
}
|