You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#lockdown Nick.Penwarden Change 3196499 on 2016/11/14 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 34.3 @ CL 3196473 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3196498 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3195674 on 2016/11/11 by Laurent.Delayen Fix for twinblast ult mesh not disappearing at lower lods. (curves not getting properly update with URO) Fixes https://jira.it.epicgames.net/browse/OR-31509 #rb lina.halper #tests twinblast ult multiPIE Change 3195245 on 2016/11/11 by Dan.Hertzka Card crafting progress - Device responds to UI actions appropriately and infinitely - Backing out of device screen goes to card details first (i.e. doesn't take you all the way out of the screen) - CraftingDevice and CraftingDeviceNode now have a few natively-controlled timelines for reversible states - Non-reversible timelines all now play from start (so they work more than once) Engine-side: - Added an overload to UTimelineComponent::SetOnTimelineFinishedFunc() that takes a native (non-dynamic) delegate - Added a way to set the owning player of a UUserWidget via a local PlayerController (since ULocalPlayer isn't a BP type) - used to establish the owner of a WidgetComponent's widget #rb none #tests PIE crafting Change 3194616 on 2016/11/11 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 34.3 @ CL3194604#RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3194615 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3193875 on 2016/11/10 by Andrew.Grant Removed GameThreadWaitForTask fatal timeout if running in editor (assumption is that some operations can cause significant blocks, and that's ok.. #jira UE-38496 #tests compiled #rb none #c0dereview Marcus.Wassmer Change 3193368 on 2016/11/10 by Mieszko.Zielinski Fixed a bug in UCharacterMovementComponent::OnMovementModeChanged making UPathFollowingComponent::OnStartedFalling being sent too late #UE4 #rb Lukasz.Furman #test golden path Change 3193280 on 2016/11/10 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 34.2 @ CL 3193232 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3193279 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3192376 on 2016/11/09 by Laurent.Delayen RootMotion Sources: removed second check, as that was a perfectly valid case. Fixes https://jira.it.epicgames.net/browse/OR-31490 #rb none #tests riftmage blackhold multiPIE Change 3192243 on 2016/11/09 by Laurent.Delayen UAbilityTask_ApplyRootMotionMoveToActorForce replicates TimeMappingCurve to potentially fix https://jira.it.epicgames.net/browse/OR-31266 #rb none #tests Jump pads on Sovereign2 multiPIE Change 3191985 on 2016/11/09 by Laurent.Delayen Additional debug info for https://jira.it.epicgames.net/browse/OR-31300 #rb none #tests compiles Change 3191565 on 2016/11/09 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 34.2 @ CL 3191371 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3191564 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3190702 on 2016/11/08 by David.Ratti Fix PIE autologgin mcp problem #rb JoshM #tests PIE autologgin Change 3190591 on 2016/11/08 by Mieszko.Zielinski Added a way to RecastNavMesh to retrieve navigation links in a given tile #UE4 #rb Lukasz.Furman #test golden path Change 3190363 on 2016/11/08 by Frank.Gigliotti Root motion velocity clamping and bug fixes; * Added option to clamp velocity when ending MoveToActorForce, MoveToForce, and RadialForce root motions. * Disabled partial ticking on the FRootMotionSource_ConstantForce when applying the finishing velocity or clamping velocity on root motion ability tasks. This ensures the desired velocity is set correctly. * Added AbilityTask_ApplyRootMotion_Base as a base class for all root motion ability tasks. #RB David.Ratti, Zak.Middleton #c0dereview Zak.Middleton #Tests PIE - Multiple heroes with root motion abilities Change 3190344 on 2016/11/08 by Laurent.Delayen RootMotionSources: Tracking down https://jira.it.epicgames.net/browse/OR-31266 Testing for 'Matches' rule in more places, to track down where it breaks. Added more info. Switched check to ensure, so it doesn't prevent playtests. Minor tweaks: - Test for ID before TimeStamp - Changed auto to proper type. - Trim RootMotionIDMappings of outdated mappings since we can iterate over that array quite a bit. #rb none #tests multiPIE Change 3190217 on 2016/11/08 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 34.2 @ CL 3190009 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3190216 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3188560 on 2016/11/07 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 34.2 @ CL 3187796 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3188499 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3188012 on 2016/11/05 by Andrew.Grant Merging using ROBO://Orion/Main->//Orion/Dev-General #rb #tests na Change 3187818 on 2016/11/04 by Michael.Noland Editor: Refactored the game instance PIE creation hooks, allowing them to pass an error message back that will be displayed to the user explaining why PIE was aborted/failed to start - Fixed a potential crash trying to tear down a null world when UGameInstance::StartPlayInEditorGameInstance fails Upgrade notes: - UGameInstance::InitializePIE overrides should now override InitializeForPlayInEditor instead - UGameInstance::StartPIEGameInstance overrides should now override StartPlayInEditorGameInstance instead - These methods return a FGameInstancePIEResult which can be created via FGameInstancePIEResult::Success() or FGameInstancePIEResult::Failure(), and take a parameter struct to make it easier to send additional information in the future without breaking the signature again #rb matt.kuhlenscmidt #tests Tested various PIE configurations in Paragon Change 3187756 on 2016/11/04 by Michael.Noland Editor: Added support for games to respond to Play in Editor setting changes (by properly calling PostEditChange when the PIE/SIE menu options are picked/toggled) #tests Tested in Paragon by binding to FCoreUObjectDelegates::OnObjectPropertyChanged #rb ben.ziegler Change 3187258 on 2016/11/04 by Dan.Hertzka - UTextBlock::SetText is now virtual - OrionTextBlock has a property ("All Caps") that, if true, will always convert all text it's given to ALL CAPS #c0dereview Sean.Smith, Philip.Buuck, Marcel.Swanepoel, Bryan.Rathman #rb none #tests PIE Change 3187157 on 2016/11/04 by Jason.Bestimt #R0B0MERGE-AUTHOR: andrew.grant Case fix for staged files #rb Ben.Marsh #tests preflighted #R0B0MERGE-SOURCE: CL 3187153 in //Orion/Release-34/... via CL 3187154 via CL 3187155 via CL 3187156 #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3186870 on 2016/11/04 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 34.2 @ CL 3186846 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3186855 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3186243 on 2016/11/03 by Michael.Noland Engine: Fixed reporting of ScreenPct when the cvar is set directly rather than via game user settings - Also fixed a place that was using ScreenPct as an integer instead of a float in the OSVR plugin #jira OR-23184 #tests Tested by setting r.screenpercentage directly to a different value and inspecting the chart results #rb ben.ziegler Change 3185134 on 2016/11/03 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 34.2 @ CL 3185065 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3185131 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3183689 on 2016/11/02 by Aaron.McLeran OR-31091 Implementing 3175639 in Dev-General #rb zak.middleton #tests unplug headphones and observe no log spam or other issues Change 3183292 on 2016/11/02 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 34.2 @ CL 3182926 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3183084 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3182323 on 2016/11/01 by Dan.Hertzka Fix crash in sequencer when opening a widget BP with the sequencer tab closed (failed to null check) #c0dereview Nick.Darnell #rb Stephan.Jiang #tests none Change 3182295 on 2016/11/01 by Daniel.Lamb Fixed up routing BeginDestroy. #rb Andrew.Grant #jira OR-31043 #test Paragon win64 -game Change 3181975 on 2016/11/01 by Daniel.Lamb Make sure to remove safe zone delegate when canvas is destroyed. Moved registration of safe zone delegate to constructor. #rb Michael.Noland #jira OR-31043 #test Paragon win64 -game Change 3181895 on 2016/11/01 by Daniel.Lamb Make sure to remove safe zone delegate when canvas is destroyed. Moved registration of safe zone delegate to constructor. #rb Michael.Noland #jira OR-31043 #test Paragon win64 -game Change 3181892 on 2016/11/01 by Michael.Trepka Copy of CL 3162466 By default, do not compile Mac OpenGL and Metal SM4 shaders while cooking #rb Mark.Satterthwaite #jira UE-37088 #tests Cooked MacNoEditor data on Windows Change 3181624 on 2016/11/01 by David.Ratti Pass attribute value by reference through SetNumericValue_Internal so that the final/clamped value is what is broadcasted to attribute change delegates #rb none #tests golden path w/ extra logging to verify final value is what is broadcasted #c0dereview Billy.Bramer, Fred.Kimberley Change 3181574 on 2016/11/01 by Jason.Bestimt #ORION_DG - Fixing up R0B0MERGE issue #RB:none #Tests:none Change 3180859 on 2016/10/31 by Brian.Karis Removed SSAO from hair Change 3180320 on 2016/10/31 by Daniel.Lamb Added support for rebuild lighting commandlet to read maps to rebuild from ini file. #rb Andrew.Grant #test Paragon rebuild lighting #jira OR-30841 Change 3180227 on 2016/10/31 by Laurent.Delayen Disabled Warning to fix https://jira.it.epicgames.net/browse/OR-30965 Will be turned into a warning message in the BP editor. #c0dereview benn.gallagher #rb none #tests none Change 3179903 on 2016/10/31 by jason.bestimt #ORION_MAIN - Merge 34.2 @ CL 3179886 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3179895 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3177903 on 2016/10/28 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 34 @ CL 3177869 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3177901 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3175548 on 2016/10/26 by Michael.Noland GameplayAbilities: Change it so that delegates registered via RegisterGameplayAttributeEvent are still called on the client when there is no aggregator entry #rb david.ratti #c0dereview billy.bramer #tests Tested in multiplayer PIE client with a new minion callback and golden path in -game Change 3175544 on 2016/10/26 by Bart.Hawthorne Draft in replays improvements: - Marker added to timeline bar that shows when the level change happens - Added "Skip Draft" button when loading a replay which will bypass the draft - Only PvP matches will record replays - Added "Exit Replay" button to hamburger menu while in draft - No longer load hero data before viewing a replay if not skipping draft - Enable replay recording in PvP #rb john.pollard #c0dereview paul.moore #tests nomcp golden path up to spawnpoint, created and loaded several replays Change 3175533 on 2016/10/26 by Michael.Noland Fix for FMallocBinned::GetAllocationSize() for aligned allocations. #jira UE-37249 #jira UE-37243 #rb robert.manuszewski #lockdown robert.manuszewski [reimplementing CL# 3165739 from Release-4.13] #tests Compiled Change 3175311 on 2016/10/26 by Daniel.Lamb Added support for safe zone change. Messed up files in last checkin #test Ps4 paragon #jira OR-30506 #rb Matt.Kuhlenschmidt Change 3175298 on 2016/10/26 by Daniel.Lamb Added support for updating safe area #rb Matt.Kuhlenschmidt #c0dereview Andrew.Grant Nick.Darnell #test Ps4 paragon #jira OR-30506 Change 3175209 on 2016/10/26 by David.Ratti Fix a few cases where default gameplay cue parameters weren't initialized properly and could not be translated by the skin system. Fixes some mayan steel issues. #rb none #tests pie Change 3174858 on 2016/10/26 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 34/33.2 @ CL 3174784 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3174857 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3174822 on 2016/10/26 by Marcus.Wassmer Duplicate 3174187 #jira UE-37020 #rb marc.audy #test create/destroy effects with HQ lights in editor. Change 3174344 on 2016/10/25 by Ryan.Gerleve Added a bIsNetStartupComponent flag to UActorComponent. This will be set for components that are owned by an actor when that actor's bNetStartup flag is set. #rb john.pollard #tests golden path Change 3174270 on 2016/10/25 by Marcus.Wassmer Add LightingChannel control to High Quality particle lights. #rb none #test tested different lighting channels. Change 3173855 on 2016/10/25 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 34 @ CL 3173292 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3173361 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3173843 on 2016/10/25 by Michael.Trepka Update custom window controls on toggle fullscreen and make sure that when we switch to windowed mode we don't use window size that wouldn't fit on desktop #rb Matt.Kuhlenschmidt #tests Tested in editor build on PC Change 3173783 on 2016/10/25 by Dan.Youhon Add VelocityOnFinish mode options to RootMotionRadialForce so that designers can control what happens to a character's velocity when the ability task ends (part of #OR-30249) #rb None #tests MultiPIE Change 3173734 on 2016/10/25 by Dan.Youhon Protect against invalid Duration in FRootMotionSource_MoveToDynamicForce on simulated clients #OR-27128 #rb None #tests MultiPIE Change 3173714 on 2016/10/25 by David.Ratti Add Game and Engine Compat versions for replays #coderview John.Pollard #rb Lietz #tests golden path, replays Change 3173681 on 2016/10/25 by Bart.Hawthorne Implement drafting in replays. A replay spectator is spawned in the draft lobby so that the draft is saved out to the replay server, and clients are now able to travel in replays both when they occur "naturally" (at the same time as if they were a client), and also by scrubbing to a place in the timeline that's a different level. The feature is implemented but currently disabled by default - turn on by setting CVarEnableDraftInReplays to 1. Replays should function the same as before. Also fixed a warning on the dedicated server related to abandoning a draft. #rb john.pollard #c0dereview josh.markiewicz, paul.moore #tests nomcp golden path (up to spawning), recorded multiple replays and played back with lots of scrubbing Change 3173677 on 2016/10/25 by Andrew.Grant Reenabled audio thread Added safety wrapper to prevent code accidentally using events after they are returned to the pool. #tests na #rb Gil.Gribb Change 3173588 on 2016/10/25 by Ryan.Gerleve Added a replication condition to skip replays. #tests golden path #rb john.pollard Change 3172692 on 2016/10/24 by Marcus.Wassmer Fix OR-30390 caused by missing mutex lock #rb none #test compile ps4 Change 3172025 on 2016/10/24 by Matt.Kuhlenschmidt Fix blur widget not respecting clip rects #rb none #tests paragon blur widget clipping bugs Change 3171570 on 2016/10/23 by Mieszko.Zielinski Moved Bots' enemy selection eqs query triggering to native code #Orion Did this to be able to manually trigger enemy selection when current enemy dies, to avoid having a "null" enemy in BB for couple of ticks. Also, made couple of tweaks to positioning and tower attacking behavior of melee bots #rb none #test golden path Change 3171100 on 2016/10/21 by Aaron.Eady FGameplayCueTagDetails; Adding a check for if the RawStructData.Num > 0 before trying to use it. There was a case where you could crash the editor if you create a new GC tag inside of a BP, compile the BP, click Add New, select a GC type, then when the file is created, click away from it in the content browser. This repro wasn't 100% but often enough to caus a problem. #rb David.Ratti (actually wrote the code) #tests PIE Change 3171060 on 2016/10/21 by Ryan.Gerleve Some cleanup and fixes for deathcam: The recording demo net driver for the deathcam replay now uses checkpoint amortization to smooth out spikes. Converted UOrionKillcamPlayback::IsKillcamWorld to IsKillcamActor, since IsKillWorld isn't useful for the new single-world implementation. Converted a GetValueOnGameThread to GetValueOnAnyThread (wasn't in the merge) so that deathcam replay recording can happen on a thread. Added comment to UAbilitySystemComponent::OnComponentDestroyed. #rb john.pollard #tests golden path, enabled deathcam Change 3171041 on 2016/10/21 by Ryan.Gerleve Make the CheckpointSaveMaxMSPerFrame value a member of UDemoNetDriver so it can be set per instance, and convert the demo.CheckpointSaveMaxMSPerFrame cvar into an override for this value. #rb john.pollard #tests golden path Change 3170917 on 2016/10/21 by Mieszko.Zielinski Made a change to OrionBTTask_ObjectiveGraphMove to make it fallback to regular move if the destination is in the same or second-closest objective graph node #Orion #rb none #test golden path Change 3170914 on 2016/10/21 by Mieszko.Zielinski Fixed EQS scoring bug resulting in some items getting NaN scored #UE4 The NaN was happening when scoring but not filtering using a bool-based test, or when unintentionally skipping items by moving item iterator without doing any work. Removed a bunch of deprecated code while there #rb Lukasz.Furman #test golden path Change 3170912 on 2016/10/21 by Mieszko.Zielinski Manual merge of crucial BT fixed over from //Fortnite/Main #UE4 Original CL#3159145 , CL#3159892 #rb Lukasz.Furman #test golden path Change 3170478 on 2016/10/21 by David.Ratti fix editor crash related to recompiling gamplay cue blueprint while a preview animation is playing that invokes that gameplay cue. #rb none #tests editor Change 3170231 on 2016/10/21 by Ryan.Gerleve Fix for an issue that was preventing moving your hero after spawning in PIE in Agora: set the net driver on static level collections as well. #tests golden path, PIE #c0dereview john.pollard #rb none Change 3170074 on 2016/10/20 by Ryan.Gerleve Merging support for recording client replays in a task parallel with Slate (optimization for deathcam) from UE4/Dev-Networking. CL 3169209 #tests golden path, replays #rb none Change 3170019 on 2016/10/20 by Ryan.Gerleve Merging support for deathcam memory optimizations (level collection work) from UE4/Main and UE4/Dev-Networking. CLs: 3134499 3134771 3135279 3137140 3138081 3140413 3150142 3142515 3162189 3162194 #tests golden path #rb none Change 3169686 on 2016/10/20 by Michael.Trepka Fixed a Windows-specific problem with parts of the custom window buttons not accepting mouse clicks when the window is maximized due to window region used by FWindowsWindow::IsPointInWindow() being offset by border size. #rb Jeff.Campeau #tests Tested in editor build on PC Change 3169668 on 2016/10/20 by Max.Chen Sequencer - Don't crash when a bool track or visibility track has a null runtime object. Copy from Odin #rb none #tests opened a recorded sequence Change 3169657 on 2016/10/20 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_33 - Fix for localization export of web data Fixed export of localized formatted text - Removed the super-specific GetSourceTextsFromFormatHistory, and replaced it with the more-generic GetHistoricFormatData to get information about an FText that was generated via FText::Format. - Added GetHistoricNumericData to get information about an FText that was generated via FText::AsNumber or FText::AsPercent. - Updated the translation picker to use GetHistoricFormatData. - Removed the code from FMultiLocHelper that used GetSourceTextsFromFormatHistory as it wasn't actually needed. - Added code to FGameDataExporter to correctly localize a formatted text for a given culture, and re-format the result for export. [c0dereviewed]: jamie.dale #RB:none #Tests:Exported game data! #R0B0MERGE-SOURCE: CL 3169653 in //Orion/Release-33/... via CL 3169654 via CL 3169655 via CL 3169656 #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3169616 on 2016/10/20 by David.Ratti missed file #rb none #tests none Change 3169597 on 2016/10/20 by David.Ratti Missed include #rb DanH #tests none Change 3169393 on 2016/10/20 by David.Ratti AbilitySystem.GlobalAbilityScale cvar to help design iterate on animation/duration based tweaks #rb none #tests pie Change 3168287 on 2016/10/19 by Mieszko.Zielinski Expanded EQS info logged with vlog #UE4 #rb none #test golden path Change 3168282 on 2016/10/19 by David.Ratti Restore warning when multiple GC notifies try to handle the same tag. #rb none #tests compile, launch editor, see warnings, cry Change 3168196 on 2016/10/19 by Jon.Lietz compile fix, removing the int version of FirstActiveIndex and leaving the in32 version. #RB none #tests compiles Change 3168041 on 2016/10/19 by Michael.Trepka Don't restore saved resolution on window activation in non-fullscreen modes #rb Matt.Kuhlenschmidt #tests Tested in editor build on PC Change 3167859 on 2016/10/19 by Aaron.McLeran UE-36288 Fixing concurrency resolution stop quietest Implementing in Dev-General for Joey since he needs the fix ASAP. #rb Jeff.Campeau #tests perform tests described in JIRA bug. Change 3167790 on 2016/10/19 by Andrew.Grant Duplication of 3167569 from //Odion/Main for Paragon cinematics #rb none #tests compiled Change 3167682 on 2016/10/19 by Laurent.Delayen Integrated #ORION_33.1 - Disabled WindSources on Cloth and AnimDynamics, as it's not safe to access from the GameThread. https://jira.it.epicgames.net/browse/OR-30473 #rb ori.cohen, benn.gallagher #tests Vamp, Kwang, Chains in Persona and PIE with WindActor in level. Change 3167466 on 2016/10/19 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 33.2 @ CL 3167368 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3167456 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3167312 on 2016/10/19 by Mieszko.Zielinski Fixed EQS template cache issues with multiple query run modes #UE4 #rb Lukasz.Furman #test golden path #jira UE-37496 Change 3166784 on 2016/10/18 by Laurent.Delayen Don't leave PhysicsBodies::bWindEnabled uninitialized in case Wind is not enabled (Persona) #rb none #c0dereview benn.gallagher #test Chains in Persona Change 3166641 on 2016/10/18 by Mieszko.Zielinski Made the value span used for EQS item score normalization configurable #UE4 #rb Lukasz.Furman #test golden path Change 3166632 on 2016/10/18 by Jason.Bestimt #R0B0MERGE-AUTHOR: andrew.grant Added support for multiple deployment sandboxes on PS4. BuildCookRun -deploy=SomeDir ps4.elf -deployedbuild=SomeDir Omitting name in -deploy/-deployedbuild falls back to previous default of using 'GameName' as the deployment sandbox. #tests BuildCookRun with -deploy and -deploy=Orion_v33, Ran PS4 with -deployedbuild and -deployedbuild=Orion_v33 [c0dereviewed] Marcus.Wassmer, Luke.Thatcher #rb none #R0B0MERGE-SOURCE: CL 3166622 in //Orion/Release-33/... via CL 3166629 via CL 3166630 via CL 3166631 #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change3166494on 2016/10/18 by Michael.Noland Engine: Removed irrelevant GPU stats from FPS chart server analytics reports #jira OR-13877 #rb david.ratti #tests Ran golden path on uncooked Win64, used forcewinmatch, and inspected the analytics arrays Change 3166476 on 2016/10/18 by Michael.Noland Cooker: Deleting dead GenerateManifestInfo methods #tests Compiled #rb none #c0dereview daniel.lamb Change 3166471 on 2016/10/18 by Michael.Noland Making sure DebugWorlds/DebugWorldNames are in sync, since we expect an index from one to match the other (fixes an issue where users could select a debug world and the wrong one was chosen). [reimplementing CL# 3157138 by Mike.Beach] #jira UE-37107 #rb Dan.OConnor #tests Tested multiplayer PIE and opening an anim BP Change 3166460 on 2016/10/18 by Michael.Noland Particles: Prevent log spam on servers about stripped emitters #rb graeme.thornton [reimplementing CL# 3157862 by Simon.Tovey] #tests Ran an uncooked server and tested golden path Change 3166339 on 2016/10/18 by Laurent.Delayen oops, this file got away. #rb none #tests none Change 3166337 on 2016/10/18 by Laurent.Delayen Fix for AnimDynamics Wind crash. https://jira.it.epicgames.net/browse/OR-30351 Access WindParameters on GameThread. Also minor optimization: don't iterate over bodies every frame if wind is off. #rb benn.gallagher #c0dereview lina.halper, thomas.sarkanen #tests Vamp Change 3166207 on 2016/10/18 by Mieszko.Zielinski Bot perception work #Orion Added a new sense that makes bots know about enemies visible on the minimap Made jungle minions do not register as sight sources Cleaned up bot perception component a bit #rb none #test golden path Change 3166138 on 2016/10/18 by Michael.Noland Blueprints: Converted a crash with the debug world name in the BP editor to an ensure until it can be fixed properly (see OR-29650) #c0dereview dan.oconnor #rb none #tests Tested opening an anim BP during multiplayer PIE Change 3165860 on 2016/10/18 by David.Ratti remove some debug code that wasn't intended to be checked in #rb none #tests compile Change 3165288 on 2016/10/17 by Ian.Fox #XMPP - Add correlation id attribute to outgoing stanzas #RB Rob.Cannaday #Tests Correlation IDs come back in responses to xmpp messages we send #JIRA OGS-409 Change 3165096 on 2016/10/17 by David.Ratti Fix issue where gameplay tags net indices would be out of sync on cooked PS4 client playing on uncooked windows servers. Would cause some effects to not play. #rb none #tests PS4/PC crossplay Change 3164973 on 2016/10/17 by Dan.Hertzka Fix link error #rb #tests compile Change 3164910 on 2016/10/17 by Lukasz.Furman fixed bug in merging behavior tree searches copy of CL 3164903 #ue4 #rb Mieszko.Zielinski #tests none Change 3164908 on 2016/10/17 by Dan.Hertzka Exposing the blur widget for use in Paragon ** Use OrionBlurWidget, not the base BackgroundBlurWidget - Added it to the hero and default tooltips for reference #rb none #c0dereview Marcel.Swanepoel, Sean.Smith, Bryan.Rathman #tests PIE Change 3164482 on 2016/10/17 by David.Ratti Editor loadtime improvements * Refactor GameplayCue manager to support two distinct object library sets: Runtime and Editor. Editor library operates on all valid gameplay cue paths but never loads or scans, only reflects what asset registry has found. Runtime library is the initial loaded paths + any explicit requests. These scan when needed and async load at startup. * Wrote UOrionAsyncLoadRequestQueue to feed the async load queue with requests at startup. This is to avoid submitting 300+ requests at startup and have them flushed by a sync load. The editor will wait until it is fully initialized before kicking these off. * Changed UOrionUIManagerWidget to weakly reference all of its state widgets. In non editor builds these are all loaded at startup like before. In editor builds, we sync load them on demand. This allows us to not load everything in order to PIE. * Added options for loading various pieces of data at editor startup: HUDwidget V4, last used hero data, and shared gameplay cues. * -game -nomcp will now properly async load initial set of data * BeginLoadAsyncData no longer takes netmode as parameter since it is confusing and can just use IsDedicatedServer() internally * Added new log category: LogOrionStartup #rb none #c0dereview Dan.Hertzka #tests pie, golden path, cooked PS4 Change 3163635 on 2016/10/14 by Laurent.Delayen AnimInstance: Pass a few FNames by reference instead of by value. Added CalcSlotMontageLocalWeight to get local a slot's local weight without a frame a lag. Fixed Montage update happening after native update on gamethread, but before native update on worker thread. Now happens before both, so we can reliably get montage weights without a frame of lag regardless of where we access it. #rb none #c0dereview martin.wilson, thomas.sarkanen #tests fixes Twinblast's primary fire blend out having a frame a lag. Change 3163620 on 2016/10/14 by Laurent.Delayen AnimNode_Slot debug: Show actual slot local weight, instead of always 1. #rb none #c0dereview martin.wilson #tests twinblast debug Change 3163061 on 2016/10/14 by Andrew.Grant Pulling test framework changes into seprate CL #rb #tests na Change 3162675 on 2016/10/13 by Jason.Bestimt #R0B0MERGE-AUTHOR: andrew.grant Merging test framework changes down early. #rb #tests na #R0B0MERGE-SOURCE: CL 3162674 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3162062 on 2016/10/13 by Michael.Trepka Replaced FWindowsCursor hack for warping the mouse cursor to the center of the viewport with a better fix for the original problem (users being able to resize the window while the cursor is hidden and the mouse controls the camera). This change removes round window corners in borderless window mode and disables window resizing when the cursor is hidden. #rb Matt.Kuhlenschmidt #tests Tested in editor build on PC Change 3161489 on 2016/10/13 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 33.2 @ CL 3161453 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3161473 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3160664 on 2016/10/12 by Ben.Salem Fix logic order error fuzzy matching on automated tests - we were only allowing one match per filter instead of one match per test. #rb adric.worley #tests Ran All Ftests that start with S Change 3159866 on 2016/10/12 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 33.2 @ CL3159727#RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3159865 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3158870 on 2016/10/11 by John.Barrett Fixed issue where some PacketHandler parsing errors, would not stop NetConnection processing of packets, and would not trigger a disconnect. #JIRA OR-29219 #rb none #tests compiles, client/server Change 3158336 on 2016/10/11 by Lukasz.Furman string pulling for local navigation grids #ue4 #rb Mieszko.Zielinski #tests PIE Change 3158203 on 2016/10/11 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 33.2 @ CL 3158043 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3158154 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3158162 on 2016/10/11 by Matt.Kuhlenschmidt Added a blur widget to umg that applies a blur effect to whatever is behind the widget - The widget has a content slot that can be used to display unblurred content on top of the blur - The widget has a low quality mode brush that can be applied instead of the background blur. This is enabled by the cvar Slate.ForceBackgroundBlurLowQualityOverride=1 - This widget is currently expermental and must be subclassed to be used #tests Tested on PS4, PC, Mac (opengl and metal) #rb nick.darnell Change 3157232 on 2016/10/10 by Lukasz.Furman added local navigation grids: dynamic obstacles on static navmesh #ue4 #rb Mieszko.Zielinski #tests none, disabled by default Change 3157112 on 2016/10/10 by Laurent.Delayen Removed my layer anim node fix, since Martin did a similar fix. #rb none #tests compiles #c0dereview martin.wilson Change 3156789 on 2016/10/10 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 33.2 @ CL 3156726 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3156788 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3156717 on 2016/10/10 by Jason.Bestimt #R0B0MERGE-AUTHOR: andrew.grant Merging 3156681 from //Orion/Release-33 to Main #rb #tests na #R0B0MERGE-SOURCE: CL 3156713 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3156596 on 2016/10/10 by Martin.Wilson Fix pose flickering on LOD change when using Layered Blend by Bone node (recreated from dev-framework CL 3112086) #Jira OR-30017 #rb Lina.Halper #tests Tested affected anim nodes in editor Change 3156149 on 2016/10/08 by Jason.Bestimt #R0B0MERGE-AUTHOR: andrew.grant Merging test framework changes from //Orion/Release-33.2 to Main (//Orion/Main) #rb #tests na #R0B0MERGE-SOURCE: CL 3156148 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3155444 on 2016/10/07 by David.Ratti -Fix crashes from FScalableFloats caching raw curve pointers by invalidating cache on curve table swaps -Removed the old code that was trying to do this in the editor on reimport, which never actually worked properly. #rb none #tests golden path Change 3155228 on 2016/10/07 by Michael.Trepka Partial (Windows implementation only) copy of CL 3151851 from //UE4/Main Added DesktopRect and WorkArea to FMonitorInfo for desktop platforms and used that to fix an issue in SceneViewport where windowed fullscreen mode would be forced to primary monitor and incorrectly positioned on desktops where a taskbar/dock/etc. was on the left #rb Dmitry.Rekman #tests Tested in editor build on PC Change 3154910 on 2016/10/07 by Lukasz.Furman added new accessors in TSimpleCellGrid and inlined bunch of functions #ue4 #rb none #tests none Change 3154906 on 2016/10/07 by Lukasz.Furman adjusted comments for FGraphAStar #ue4 #rb none #tests none Change 3154679 on 2016/10/07 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 33 @ CL 3154662 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3154677 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3153638 on 2016/10/06 by Andrew.Grant Duplicating fix for UE-36087 from UE4 #rb #tests na Change 3153325 on 2016/10/06 by David.Ratti CurveTableSets: support for multiple spread sheets -Sovereign data located in Sovereign subfolder, cloned from base data. #rb none #tests PIE, golden path Change 3153318 on 2016/10/06 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge DUI @ CL 3152667 #RB:none #Tests:none [c0dereviewed]: kerrington.smith, matt.schembari #R0B0MERGE-SOURCE: CL 3153310 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change3153268on 2016/10/06 by David.Ratti Missed file for engine changes #rb none #tests none Change 3153264 on 2016/10/06 by David.Ratti Move some DetailCustomziation classes to public folder so that games can override/extend them. Also made some virtual functions to override the things paragon needs to. #rb none #tests paragon editor Change 3153204 on 2016/10/06 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 32.2/33 @ CL 3152587 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3153171 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3152699 on 2016/10/05 by Andrew.Grant I apologize for the mega-checkin but there are a lot of dependencies here, the work spiralled, and I've been cranking to get this in for the v33 branch. Please review and comment on what you know about and don't worry about the rest :) -Added options-struct to MallocLeak detection to allow filtering open callstacks by frame range and size. This is now used in Paragon automatic tests to dump out memory left loaded by the previous map. -PS4StackWalk now uses lowercase filenames as this is how non-UFS files are staged -Renamed Orion.Foo.cs test scripts to OrionTest.Foo.cs -Split some Orion tests into seprate scripts -Added concept of "TestControllers". These are constructed by OrionEngine based on the -test= commandline and provide a super-simple way to implent state-based logic and checks by overriding base class functions. -Added controllers for Boot, Soak, and Leak checks -Renamed SimpleSolo bot to SimpleSoak. Moved a lot of logic about match composition and state to OrionTestControllerSoak -Added new MatchStarted/MatchEnded delegates to OrionGameState for clients -Fixed issues where OrionGameState_Base::HasMatchStarted would return true for WaitingForPlayers and MatchCountdown -OrionBot code no longer caches command line since some TestControllers set it at runtime -Added some ensures in Draft logic to catch/guard against a crash being triggered by bots. #rb none #tests verified all of the above and much more! #c0dereview David.Ratti, Marcus.Wasmer,Michael.Noland Change 3152605 on 2016/10/05 by Andrew.Grant Suppressed warning about missing parent if parent package was in the KnownMissingPackageList Added Editor ScaleRef stuff to Orion to suppress cooked warning #rb none #c0dereview Marcus.Wassmer #tests Verified warning about ScaleRef being missing is gone Change 3152596 on 2016/10/05 by Andrew.Grant Made ASLR an option that can be disabled. Disabled ASLR for Paragon PS4 Test builds so symbol lookup is available for diagnostics. Made "don't optimize adaptive unity files" an official feature, off by default but turned on in Paragon #c0dereview Luke.Thatcher #rb none #tests Verified test build has symbols that can be resolved. Verified an adaptive unity file is non-optimized, but non-adaptive files are optimized as normal Change 3152399 on 2016/10/05 by Josh.Markiewicz #UE4 - temporary fix for OSS R0B0MERGE issue #rb david.nikdel #test compiles Change 3150916 on 2016/10/04 by Daniel.Lamb Removed warning when shader compiler is in a bad state. #rb Andrew.Grant #jira OR-29580 #test Cook paragon Change 3150889 on 2016/10/04 by Ben.Salem Add log feedback to automation harness when processing commands, including syntax helpers when an unhandled command is added. #rb adric.worley #tests Ran several commands to see log output. Change 3150844 on 2016/10/04 by Lukasz.Furman compilation fix #rb none #tests none Change 3150759 on 2016/10/04 by Lukasz.Furman added "hidden" state to gameplay debugger category #ue4 #rb Mieszko.Zielinski #tests config changes and PIE Change 3150758 on 2016/10/04 by Lukasz.Furman pass on SimpleCellGrid template to make it usable for local navigation grids #orion #rb Mieszko.Zielinski #tests PIE on agora, AI tactics debug on agora Change 3150567 on 2016/10/04 by Dan.Hertzka Rough initial implementation of a generic UI layer for moving widgets around to and from arbitrary locations. Lots of possible uses. For example, equipping a card in the card shop that then animates down into the correct hand slot. - Not in actual use anywhere yet #rb none #tests PIE Change 3150307 on 2016/10/04 by Laurent.Delayen Removed check() not considering SimulatedRootMotion for RemoteClients. #rb none #tests compiles Change 3150236 on 2016/10/04 by Josh.Markiewicz #UE4 - added documentation to FNetworkNotify interface - fixed bad UE_LOG category while double checking the above #rb none #tests compiles Change3150206on 2016/10/04 by Josh.Markiewicz #UE4 - moved ClientTravelToSession out of AGameSession and into UGameInstance - removed similar function from UGameInstanceCommon - more common usage location #rb none #c0dereview paul.moore #tests rejoin vectors and golden path Change 3150073 on 2016/10/04 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 32.2/33 @ CL 3150010 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3150072 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3150031 on 2016/10/04 by Mieszko.Zielinski New AIData provider that generated random numbers #UE4 #rb Lukasz.Furman #test golden path Change 3149946 on 2016/10/04 by Ben.Woodhouse Make UPrimitiveComponents (and derived variants) take proxy memory into account in GetResourceSize() We do this by dereferencing the SceneProxy directly, but this should be safe, since we NULL it on the gamethread before the proxy is released. #jira OR-26778 #rb luke.thatcher #tests compile, run Win64 with -game, run editor Change 3149743 on 2016/10/03 by Ben.Salem Null check for blank test names when making functional tests to repair crash on server. #rb nick.darnell #tests Ran multiple FTests Change 3149460 on 2016/10/03 by Laurent.Delayen Refactored TickCharacterPose. Now calls 'ShouldTickPose' so it can get properly obey bPauseAnims, MeshComponentUpdateFlag and other conditions. Still forces updates when playing networked root motion montages, and that check is now done inside of USkeletalMeshComponent::ShouldTickPose(). Fixes human players always calling TickPose regardless of settings on dedicated servers. Also addresses Jira UE-34720 #rb martin.wilson #tests networked Vamp x2 + golden path Change 3149435 on 2016/10/03 by Mieszko.Zielinski Fixed a bug in EQS item score normalization for the purposes of drawing #UE4 Also, made printed out scores not normalized since seeing original EQS calculated score desirable #rb Lukasz.Furman #test golden path Change 3148550 on 2016/10/03 by John.Barrett Fixed bad/blocking ensure added in FBitReader. OR-29219 #tests compile #rb none Change 3147460 on 2016/09/30 by Laurent.Delayen Fixed AOrionChar::UpdateAnimationTicking never setting EMeshComponentUpdateFlag::OnlyTickPoseWhenRendered, because OnMontageEnded() is called before the MontageInstance is actually removed and deleted. Added OnAllMontageInstancesEnded to AnimInstance, and used that to call UpdateAnimationTicking. #rb michael.noland #tests Golden Path Change 3146677 on 2016/09/30 by Jamie.Dale Fixed UGatherTextFromSourceCommandlet::ParseSourceText being able to underflow while parsing #rb Andrew.Rodham #tests Ran the gather Change 3146555 on 2016/09/30 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 32.2 @ CL 3146524 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3146553 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3146129 on 2016/09/29 by Michael.Noland Engine: Fixed the spectator camera (used in ToggleDebugCamera) so it moves consistently regardless of the slomo value by using the raw frame delta rather than trying to counter-correct for time dilation #c0dereview marc.audy #rb none #tests Tested ToggleDebugCamera with slomo 0.00001 Change 3145574 on 2016/09/29 by Adric.Worley Fix FunctionalTestingManager not compiling when included #tests compile #rb mieszko.zielinski Change 3145224 on 2016/09/29 by Michael.Trepka Better check for whether or not PreFullscreenWindowPlacement in FWindowsWindow is valid #rb Dmitry.Rekman #tests Tested editor build on PC Change 3145132 on 2016/09/29 by Alexis.Matte Make sure we use GetMesh instead of the SkeletalMeshPtr variable. #jira OR-29617 #rb matt.kuhlenschmidt #test none Change 3144926 on 2016/09/29 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 32.2 @ CL 3144835 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3144925 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3144920 on 2016/09/29 by Benn.Gallagher Added "Reset Clothing Sim" anim notify to trigger a clothing reset from an animation, to help with issues arising from extreme movements in animations. #rb James.Golding #tests Editor + -game vamp RMB abilities using new notify Change 3144055 on 2016/09/28 by Jason.Bestimt #R0B0MERGE-AUTHOR: ben.marsh BuildGraph: Fix builds created with preconditions on nodes behind triggers, causing nightly builds to run forever due to conditions never evaluating to true. #rb none #tests Compared exported job definition before and after #R0B0MERGE-SOURCE: CL 3143992 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3143801 on 2016/09/28 by Mieszko.Zielinski Made UAIBlueprintHelperLibrary::CreateMoveToProxyObject deduce WorldContextObject from Pawn if not received from BP #Orion Also, made failing to do so not fails a check #rb Lukasz.Furman #test golden path #c0dereview Aaron.Eady Change 3142377 on 2016/09/27 by Jason.Bestimt #R0B0MERGE-AUTHOR: marcus.wassmer Fix crashes when using GBuffer resources in simpleforward mode. #rb Daniel.Wright #test vamp Q on low settings. #R0B0MERGE-SOURCE: CL 3142376 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3141628 on 2016/09/27 by David.Ratti Guard against recursion in WaitGameplayEffectApplied ability task #rb none #tests pie crash case Change 3141497 on 2016/09/27 by Marcus.Wassmer Duplicate 3123743 Separate skeletal/static mesh lod interfaces #rb none #test created an LOD for vamp locally. Change3140832on 2016/09/26 by Jason.Bestimt #R0B0MERGE-AUTHOR: marcus.wassmer Remove dubious non-threadsafe GBuffer reference adjustments. Possibly fix OR-29506 #rb none #test PC on all settings #R0B0MERGE-SOURCE: CL 3140831 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3140828 on 2016/09/26 by Uriel.Doyon Workaround (reverting previous attemp) at fixing issue with FTextRenderSceneProxy when running command let. #rb marcus.wassmer #tests running lighting build with command let & loading editor Change 3140331 on 2016/09/26 by Jason.Bestimt #R0B0MERGE-AUTHOR: andrew.grant Cloning fix for UE-36253 from //UE4/Dev-Framework/... #rb #tests na #R0B0MERGE-SOURCE: CL 3140329 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3139976 on 2016/09/26 by David.Ratti balance tweaker + some prep for multiple data tables support #rb none #tests pie, golden path Change 3139904 on 2016/09/26 by Jason.Bestimt #R0B0MERGE-AUTHOR: andrew.grant Adding code to log name of package that refuses to load... #rb none #tests compiled #R0B0MERGE-SOURCE: CL 3139902 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change3139871on 2016/09/26 by Jason.Bestimt #R0B0MERGE-AUTHOR: andrew.grant Fixes for OR-29229 and OR-29413 #rb #tests na #R0B0MERGE-SOURCE: CL 3139870 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3139751 on 2016/09/26 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 32.2 @ CL 3139692 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL3139740in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3139451 on 2016/09/25 by Uriel.Doyon Submitted a workaround for the lighting build command let crash. #rb none #tests loaded editor, built lighting command let Change 3138304 on 2016/09/23 by David.Ratti Fix checkslow in Debug editor #rb none #tests debug editor #c0dereview Martin.Wilson Change 3138068 on 2016/09/23 by Laurent.Delayen Don't try to match invalid GUIDs in FSmartNameMapping::GetNameByGuid. Fixes Steel's curves all getting matched to 'DistanceCurve' #rb martin.wilson #tests Steel's curve are not all 'DistanceCurve' Change 3137830 on 2016/09/23 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 32.2 @ CL 3137699 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3137746 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3137657 on 2016/09/23 by Ben.Marsh Fix initialization order warning. #rb none #tests none Change 3137628 on 2016/09/23 by bruce.nesbit Fixed non-unity compiles in LandscapeSplines and LandscapeSplineRaster #rb none #tests Compiled NU Change 3137538 on 2016/09/23 by Thomas.Sarkanen Fix crash rendering sequence with keyframed material parameters Ported Frank F's fix from Dev-Sequencer. Original CL 3136577: Sequencer - Always use a unique name when creating dynamic material instances for animation to prevent reuse and resource issues. #tests Rendered out problematic sequence successfully multiple times #rb none #jira UE-36175 - Keyframing material parameters can cause crashes when rendering #c0dereview Frank.Fella Change 3136580 on 2016/09/22 by Ben.Marsh Merging CL 3136158 to fix support for generating project files with Visual Studio Express. #rb none #tests none Change 3136574 on 2016/09/22 by Michael.Trepka Fixed a crash caused by trying to redraw window contents while switching from fullscreen to windowed mode #rb Marcus.Wassmer #tests Tested editor build on PC Change 3136293 on 2016/09/22 by Adric.Worley Add BlueprintType to EFunctionalTestResult #tests editor #rb ben.salem #c0dereview nick.darnell Change 3136240 on 2016/09/22 by Andrew.Grant Merging from //UE4/Main @ 3135156 #rb none #tests QA pass and local golden path Change 3136197 on 2016/09/22 by Jamie.Dale Merging CL# 3094477 and CL# 3111827 to fix some tesselated landscape crashes #rb Gareth.Martin #tests Loaded the map that was crashing Change 3135914 on 2016/09/22 by Dan.Youhon Fixed CharacterMovementComponent impulse net correction handling during additive root motion (part of #OR-5545) - Fixes #OR-28478, heroes tethered by Kwang cannot be knocked up - Fixes #OR-18985, Gideon R ability negating knockback/knockup effects (including Howitzer E) #rb None #tests MultiPIE #R0B0MERGE: MAIN, 32.2, 32.1 Change 3135893 on 2016/09/22 by David.Ratti GameplayCueeditir Change override type from a checkbox to a combobox to make things a little clearer #rb none #tests gameplaycue editor Change 3135843 on 2016/09/22 by jason.bestimt #ORION_MAIN - Merge 32.2 @ CL 3135756 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3135820 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) #R0B0MERGE-SAYS: Beep boop! I couldn't merge this change. Please do it yourself, human. //Orion/Dev-General/OrionGame/Content/Balance/HeroData.uasset - can't integrate exclusive file already opened //Orion/Dev-General/OrionGame/Content/Cards/Effects/P_ThunderCleaver.uasset - can't integrate exclusive file already opened //Orion/Dev-General/OrionGame/DataTables/HeroData.xlsm - can't integrate exclusive file already opened #c0dereview: jason.bestimt Change 3134639 on 2016/09/21 by jason.bestimt #ORION_MAIN - Merge 32.2 @ CL3133910#RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3134086 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) #R0B0MERGE-SAYS: Beep boop! I couldn't merge this change. Please do it yourself, human. #c0dereview: jason.bestimt Change 3134367 on 2016/09/21 by Ben.Woodhouse More complete fix for SSAO issues. Disable vertex fogging automatically if forward shading is disabled #rb daniel.wright #tests none Change 3134176 on 2016/09/21 by Jason.Bestimt #ORION_DG - UnrealPak speed improvements Moving shelved CL to DG and submitting for DanielL #RB:none #Tests:none #c0dereview: andrew.grant, daniel.lamb Change 3134129 on 2016/09/21 by Jamie.Dale Added the "unattended" flag when running the localzation commandlets via UAT #rb none #tests Built UAT Change 3133864 on 2016/09/21 by Ben.Woodhouse Default r.VertexFoggingForOpaque to 0, since it only makes sense for forward shading. This was causing fog to be modulated by SSAO in Orion. Note: this setting is overridden to 1 in Odin's DefaultEngine.ini, so it should work in that case. #c0dereview daniel.wright #rb luke.thatcher #jira OR-29262 #tests yes Change 3133849 on 2016/09/21 by Martin.Wilson Fix pose blending for on non-additive pose blending + remove normalising of weights for weights less than 1 #rb Jurre.DeBaare #tests Editor tests with mambo pose asset #jira UE-36189 Change 3133546 on 2016/09/20 by Jason.Bestimt #R0B0MERGE-AUTHOR: marcus.wassmer Null merge of3131588. Fix from 31.1 is unncecessary as a more complete fix came from the engine integration that's in v32. #rb none #tests none [c0dereviewed] Jason.Bestimt #R0B0MERGE-SOURCE: CL 3132617 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3133487 on 2016/09/20 by Michael.Noland Automation: Added Automation to the manual autocomplete list Change 3133363 on 2016/09/20 by Daniel.Lamb Added Jaymee Sanford and Tony Oliva to the rebuild lighting email list. #rb Trivial #test Compile automation tool Change 3132956 on 2016/09/20 by Benn.Gallagher Fixed crash when importing clothing with mismatching number of triangles when compared to the original render data #tests Editor, apex reimport #rb none Change 3132403 on 2016/09/20 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 32.2 @ CL 3132254 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3132353 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3132332 on 2016/09/20 by Andrew.Grant Replicated UE4/Main fix for missing materials pane #rb none #tests verified material pane shows Change 3132131 on 2016/09/20 by Jason.Bestimt #R0B0MERGE-AUTHOR: andrew.grant Merging automation work from //Orion/Release-32.2 to Main #rb none #tests verified functionality #R0B0MERGE-SOURCE: CL 3132130 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) Change 3131698 on 2016/09/19 by Andrew.Grant Qucik fix to unblock build. Will follow up correct way tomorrow #rb none #tests blueprint compiles Change 3131489 on 2016/09/19 by Andrew.Grant Merging from //UE4/Orion-Staging (Source: //UE4/Main @ 3111290) #rb none #tests QA pass in Orion-Staging, Golden path post merge Change 3131350 on 2016/09/19 by Adric.Worley Fix functional test reporting typo #tests PIE #rb ben.salem Change 3130959 on 2016/09/19 by Mieszko.Zielinski Compilation fix #UE4 #rb none #test compilation Change 3130904 on 2016/09/19 by Mieszko.Zielinski Couple of generic AI perception fixes #UE4 Made unregistering AI sight source broadcast "no longer visible" information to all observers currently "seeing" the source Fixed FActorPerceptionInfo::GetLastStimulusLocation not carying whether selected stimulus was successfully sensed Fixed dominant sense not really working if not set with UAIPerceptionComponent::SetDominantSense call #rb Lukasz.Furman #test golden path Change 3130304 on 2016/09/19 by Jason.Bestimt #R0B0MERGE-AUTHOR: jason.bestimt #ORION_MAIN - Merge 32.2 @ CL 3130115 #RB:none #Tests:none #R0B0MERGE-SOURCE: CL 3130164 in //Orion/Main/... #R0B0MERGE-BOT: ORION (Main -> Dev-General) [CL 3205566 by Andrew Grant in Main branch]
2046 lines
86 KiB
C#
2046 lines
86 KiB
C#
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Diagnostics;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text.RegularExpressions;
|
|
using System.Xml;
|
|
using Tools.DotNETCommon.CaselessDictionary;
|
|
|
|
namespace UnrealBuildTool
|
|
{
|
|
/// <summary>
|
|
/// Distribution level of module.
|
|
/// Note: The name of each entry is used to search for/create folders
|
|
/// </summary>
|
|
public enum UEBuildModuleDistribution
|
|
{
|
|
/// Binaries can be distributed to everyone
|
|
Public,
|
|
|
|
/// Can be used by UE4 but not required
|
|
CarefullyRedist,
|
|
|
|
/// Epic Employees and Contractors
|
|
NotForLicensees,
|
|
|
|
/// Epic Employees only
|
|
NoRedist,
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// A unit of code compilation and linking.
|
|
/// </summary>
|
|
public abstract class UEBuildModule
|
|
{
|
|
/// <summary>
|
|
/// Checks what distribution level a particular path should have by checking for key folders anywhere in it
|
|
/// </summary>
|
|
public static UEBuildModuleDistribution GetModuleDistributionLevelBasedOnLocation(string FilePath)
|
|
{
|
|
// Get full path to ensure all folder separators are the same
|
|
FilePath = Path.GetFullPath(FilePath);
|
|
|
|
// Check from highest to lowest (don't actually need to check 'Everyone')
|
|
for (UEBuildModuleDistribution DistributionLevel = UEBuildModuleDistribution.NoRedist; DistributionLevel > UEBuildModuleDistribution.Public; DistributionLevel--)
|
|
{
|
|
string DistributionFolderName = String.Format("{0}{1}{0}", Path.DirectorySeparatorChar, DistributionLevel.ToString());
|
|
if (FilePath.IndexOf(DistributionFolderName, StringComparison.InvariantCultureIgnoreCase) >= 0)
|
|
{
|
|
return DistributionLevel;
|
|
}
|
|
|
|
if (DistributionLevel == UEBuildModuleDistribution.NotForLicensees)
|
|
{
|
|
// Extra checks for PS4 and XboxOne folders, which are equivalent to NotForLicensees
|
|
string PS4FolderName = String.Format("{0}ps4{0}", Path.DirectorySeparatorChar);
|
|
string XboxFolderName = String.Format("{0}xboxone{0}", Path.DirectorySeparatorChar);
|
|
if (FilePath.IndexOf(PS4FolderName, StringComparison.InvariantCultureIgnoreCase) >= 0
|
|
|| FilePath.IndexOf(XboxFolderName, StringComparison.InvariantCultureIgnoreCase) >= 0)
|
|
{
|
|
return UEBuildModuleDistribution.NotForLicensees;
|
|
}
|
|
}
|
|
}
|
|
|
|
return UEBuildModuleDistribution.Public;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Determines the distribution level of a module based on its directory and includes.
|
|
/// </summary>
|
|
public UEBuildModuleDistribution DetermineDistributionLevel()
|
|
{
|
|
List<string> PathsToCheck = new List<string>();
|
|
PathsToCheck.Add(ModuleDirectory.FullName);
|
|
PathsToCheck.AddRange(PublicIncludePaths);
|
|
PathsToCheck.AddRange(PrivateIncludePaths);
|
|
// Not sure if these two are necessary as paths will usually be in basic includes too
|
|
PathsToCheck.AddRange(PublicSystemIncludePaths);
|
|
PathsToCheck.AddRange(PublicLibraryPaths);
|
|
|
|
UEBuildModuleDistribution DistributionLevel = UEBuildModuleDistribution.Public;
|
|
|
|
if (!Rules.bOutputPubliclyDistributable)
|
|
{
|
|
// Keep checking as long as we haven't reached the maximum level
|
|
for (int PathIndex = 0; PathIndex < PathsToCheck.Count && DistributionLevel != UEBuildModuleDistribution.NoRedist; ++PathIndex)
|
|
{
|
|
DistributionLevel = Utils.Max(DistributionLevel, UEBuildModule.GetModuleDistributionLevelBasedOnLocation(PathsToCheck[PathIndex]));
|
|
}
|
|
}
|
|
|
|
return DistributionLevel;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts an optional string list parameter to a well-defined hash set.
|
|
/// </summary>
|
|
protected static HashSet<string> HashSetFromOptionalEnumerableStringParameter(IEnumerable<string> InEnumerableStrings)
|
|
{
|
|
return InEnumerableStrings == null ? new HashSet<string>() : new HashSet<string>(InEnumerableStrings);
|
|
}
|
|
|
|
/// <summary>
|
|
/// The name that uniquely identifies the module.
|
|
/// </summary>
|
|
public readonly string Name;
|
|
|
|
/// <summary>
|
|
/// The type of module being built. Used to switch between debug/development and precompiled/source configurations.
|
|
/// </summary>
|
|
public UHTModuleType Type;
|
|
|
|
/// <summary>
|
|
/// The rules for this module
|
|
/// </summary>
|
|
public ModuleRules Rules;
|
|
|
|
/// <summary>
|
|
/// Path to the module directory
|
|
/// </summary>
|
|
public readonly DirectoryReference ModuleDirectory;
|
|
|
|
/// <summary>
|
|
/// Is this module allowed to be redistributed.
|
|
/// </summary>
|
|
private readonly bool? IsRedistributableOverride;
|
|
|
|
/// <summary>
|
|
/// The name of the .Build.cs file this module was created from, if any
|
|
/// </summary>
|
|
public FileReference RulesFile;
|
|
|
|
/// <summary>
|
|
/// The binary the module will be linked into for the current target. Only set after UEBuildBinary.BindModules is called.
|
|
/// </summary>
|
|
public UEBuildBinary Binary = null;
|
|
|
|
/// <summary>
|
|
/// Include path for this module's base directory, relative to the Engine/Source directory
|
|
/// </summary>
|
|
protected string NormalizedModuleIncludePath;
|
|
|
|
/// <summary>
|
|
/// The name of the _API define for this module
|
|
/// </summary>
|
|
protected readonly string ModuleApiDefine;
|
|
|
|
protected readonly HashSet<string> PublicDefinitions;
|
|
protected readonly HashSet<string> PublicIncludePaths;
|
|
protected readonly HashSet<string> PrivateIncludePaths;
|
|
protected readonly HashSet<string> PublicSystemIncludePaths;
|
|
protected readonly HashSet<string> PublicLibraryPaths;
|
|
protected readonly HashSet<string> PublicAdditionalLibraries;
|
|
protected readonly HashSet<string> PublicFrameworks;
|
|
protected readonly HashSet<string> PublicWeakFrameworks;
|
|
protected readonly HashSet<UEBuildFramework> PublicAdditionalFrameworks;
|
|
protected readonly HashSet<string> PublicAdditionalShadowFiles;
|
|
protected readonly HashSet<UEBuildBundleResource> PublicAdditionalBundleResources;
|
|
|
|
/// <summary>
|
|
/// Names of modules with header files that this module's public interface needs access to.
|
|
/// </summary>
|
|
protected List<UEBuildModule> PublicIncludePathModules;
|
|
|
|
/// <summary>
|
|
/// Names of modules that this module's public interface depends on.
|
|
/// </summary>
|
|
protected List<UEBuildModule> PublicDependencyModules;
|
|
|
|
/// <summary>
|
|
/// Names of DLLs that this module should delay load
|
|
/// </summary>
|
|
protected HashSet<string> PublicDelayLoadDLLs;
|
|
|
|
/// <summary>
|
|
/// Names of modules with header files that this module's private implementation needs access to.
|
|
/// </summary>
|
|
protected List<UEBuildModule> PrivateIncludePathModules;
|
|
|
|
/// <summary>
|
|
/// Names of modules that this module's private implementation depends on.
|
|
/// </summary>
|
|
protected List<UEBuildModule> PrivateDependencyModules;
|
|
|
|
/// <summary>
|
|
/// Extra modules this module may require at run time
|
|
/// </summary>
|
|
protected List<UEBuildModule> DynamicallyLoadedModules;
|
|
|
|
/// <summary>
|
|
/// Extra modules this module may require at run time, that are on behalf of another platform (i.e. shader formats and the like)
|
|
/// </summary>
|
|
protected List<UEBuildModule> PlatformSpecificDynamicallyLoadedModules;
|
|
|
|
/// <summary>
|
|
/// Files which this module depends on at runtime.
|
|
/// </summary>
|
|
public RuntimeDependencyList RuntimeDependencies;
|
|
|
|
/// <summary>
|
|
/// Returns a list of this module's immediate dependencies.
|
|
/// </summary>
|
|
/// <returns>An enumerable containing the dependencies of the module.</returns>
|
|
public IEnumerable<UEBuildModule> GetDirectDependencyModules()
|
|
{
|
|
return PublicDependencyModules.Concat(PrivateDependencyModules).Concat(DynamicallyLoadedModules).Concat(PlatformSpecificDynamicallyLoadedModules);
|
|
}
|
|
|
|
public UEBuildModule(
|
|
string InName,
|
|
UHTModuleType InType,
|
|
DirectoryReference InModuleDirectory,
|
|
ModuleRules InRules,
|
|
FileReference InRulesFile
|
|
)
|
|
{
|
|
Name = InName;
|
|
Type = InType;
|
|
ModuleDirectory = InModuleDirectory;
|
|
Rules = InRules;
|
|
RulesFile = InRulesFile;
|
|
|
|
NormalizedModuleIncludePath = Utils.CleanDirectorySeparators(ModuleDirectory.MakeRelativeTo(UnrealBuildTool.EngineSourceDirectory), '/');
|
|
ModuleApiDefine = Name.ToUpperInvariant() + "_API";
|
|
|
|
PublicDefinitions = HashSetFromOptionalEnumerableStringParameter(InRules.Definitions);
|
|
PublicIncludePaths = HashSetFromOptionalEnumerableStringParameter(InRules.PublicIncludePaths);
|
|
PublicSystemIncludePaths = HashSetFromOptionalEnumerableStringParameter(InRules.PublicSystemIncludePaths);
|
|
PublicLibraryPaths = HashSetFromOptionalEnumerableStringParameter(InRules.PublicLibraryPaths);
|
|
PublicAdditionalLibraries = HashSetFromOptionalEnumerableStringParameter(InRules.PublicAdditionalLibraries);
|
|
PublicFrameworks = HashSetFromOptionalEnumerableStringParameter(InRules.PublicFrameworks);
|
|
PublicWeakFrameworks = HashSetFromOptionalEnumerableStringParameter(InRules.PublicWeakFrameworks);
|
|
PublicAdditionalFrameworks = InRules.PublicAdditionalFrameworks == null ? new HashSet<UEBuildFramework>() : new HashSet<UEBuildFramework>(InRules.PublicAdditionalFrameworks);
|
|
PublicAdditionalShadowFiles = HashSetFromOptionalEnumerableStringParameter(InRules.PublicAdditionalShadowFiles);
|
|
PublicAdditionalBundleResources = InRules.AdditionalBundleResources == null ? new HashSet<UEBuildBundleResource>() : new HashSet<UEBuildBundleResource>(InRules.AdditionalBundleResources);
|
|
PublicDelayLoadDLLs = HashSetFromOptionalEnumerableStringParameter(InRules.PublicDelayLoadDLLs);
|
|
PrivateIncludePaths = HashSetFromOptionalEnumerableStringParameter(InRules.PrivateIncludePaths);
|
|
RuntimeDependencies = (InRules.RuntimeDependencies == null) ? new RuntimeDependencyList() : new RuntimeDependencyList(InRules.RuntimeDependencies);
|
|
IsRedistributableOverride = InRules.IsRedistributableOverride;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Determines whether this module has a circular dependency on the given module
|
|
/// </summary>
|
|
public bool HasCircularDependencyOn(string ModuleName)
|
|
{
|
|
return Rules.CircularlyReferencedDependentModules.Contains(ModuleName);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Find all the modules which affect the public compile environment. Searches through
|
|
/// </summary>
|
|
/// <param name="Modules"></param>
|
|
/// <param name="bIncludePathsOnly"></param>
|
|
/// <param name="DependencyModules"></param>
|
|
protected void FindModulesInPublicCompileEnvironment(List<UEBuildModule> Modules, Dictionary<UEBuildModule, bool> ModuleToIncludePathsOnlyFlag)
|
|
{
|
|
//
|
|
bool bModuleIncludePathsOnly;
|
|
if (!ModuleToIncludePathsOnlyFlag.TryGetValue(this, out bModuleIncludePathsOnly))
|
|
{
|
|
Modules.Add(this);
|
|
}
|
|
else if (!bModuleIncludePathsOnly)
|
|
{
|
|
return;
|
|
}
|
|
|
|
ModuleToIncludePathsOnlyFlag[this] = false;
|
|
|
|
foreach (UEBuildModule DependencyModule in PublicDependencyModules)
|
|
{
|
|
DependencyModule.FindModulesInPublicCompileEnvironment(Modules, ModuleToIncludePathsOnlyFlag);
|
|
}
|
|
|
|
// Now add an include paths from modules with header files that we need access to, but won't necessarily be importing
|
|
foreach (UEBuildModule IncludePathModule in PublicIncludePathModules)
|
|
{
|
|
IncludePathModule.FindIncludePathModulesInPublicCompileEnvironment(Modules, ModuleToIncludePathsOnlyFlag);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Find all the modules which affect the public compile environment. Searches through
|
|
/// </summary>
|
|
/// <param name="Modules"></param>
|
|
/// <param name="bIncludePathsOnly"></param>
|
|
/// <param name="DependencyModules"></param>
|
|
protected void FindIncludePathModulesInPublicCompileEnvironment(List<UEBuildModule> Modules, Dictionary<UEBuildModule, bool> ModuleToIncludePathsOnlyFlag)
|
|
{
|
|
if (!ModuleToIncludePathsOnlyFlag.ContainsKey(this))
|
|
{
|
|
// Add this module to the list
|
|
Modules.Add(this);
|
|
ModuleToIncludePathsOnlyFlag.Add(this, true);
|
|
|
|
// Include any of its public include path modules in the compile environment too
|
|
foreach (UEBuildModule IncludePathModule in PublicIncludePathModules)
|
|
{
|
|
IncludePathModule.FindIncludePathModulesInPublicCompileEnvironment(Modules, ModuleToIncludePathsOnlyFlag);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Sets up the environment for compiling any module that includes the public interface of this module.
|
|
/// </summary>
|
|
public void AddModuleToCompileEnvironment(
|
|
UEBuildBinary SourceBinary,
|
|
bool bIncludePathsOnly,
|
|
HashSet<string> IncludePaths,
|
|
HashSet<string> SystemIncludePaths,
|
|
List<string> Definitions,
|
|
List<UEBuildFramework> AdditionalFrameworks
|
|
)
|
|
{
|
|
// Add this module's public include paths and definitions.
|
|
AddIncludePathsWithChecks(IncludePaths, PublicIncludePaths);
|
|
AddIncludePathsWithChecks(SystemIncludePaths, PublicSystemIncludePaths);
|
|
Definitions.AddRange(PublicDefinitions);
|
|
|
|
// If this module is being built into a DLL or EXE, set up an IMPORTS or EXPORTS definition for it.
|
|
if (Binary == null)
|
|
{
|
|
// If we're referencing include paths for a module that's not being built, we don't actually need to import anything from it, but we need to avoid barfing when
|
|
// the compiler encounters an _API define. We also want to avoid changing the compile environment in cases where the module happens to be compiled because it's a dependency
|
|
// of something else, which cause a fall-through to the code below and set up an empty _API define.
|
|
if (bIncludePathsOnly)
|
|
{
|
|
Log.TraceVerbose("{0}: Include paths only for {1} (no binary)", SourceBinary.Config.OutputFilePaths[0].GetFileNameWithoutExtension(), Name);
|
|
Definitions.Add(ModuleApiDefine + "=");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
FileReference BinaryPath = Binary.Config.OutputFilePaths[0];
|
|
FileReference SourceBinaryPath = SourceBinary.Config.OutputFilePaths[0];
|
|
|
|
if (ProjectFileGenerator.bGenerateProjectFiles || (Binary.Config.Type == UEBuildBinaryType.StaticLibrary))
|
|
{
|
|
// When generating IntelliSense files, never add dllimport/dllexport specifiers as it
|
|
// simply confuses the compiler
|
|
Definitions.Add(ModuleApiDefine + "=");
|
|
}
|
|
else if (Binary == SourceBinary)
|
|
{
|
|
if (Binary.Config.bAllowExports)
|
|
{
|
|
Log.TraceVerbose("{0}: Exporting {1} from {2}", SourceBinaryPath.GetFileNameWithoutExtension(), Name, BinaryPath.GetFileNameWithoutExtension());
|
|
Definitions.Add(ModuleApiDefine + "=DLLEXPORT");
|
|
}
|
|
else
|
|
{
|
|
Log.TraceVerbose("{0}: Not importing/exporting {1} (binary: {2})", SourceBinaryPath.GetFileNameWithoutExtension(), Name, BinaryPath.GetFileNameWithoutExtension());
|
|
Definitions.Add(ModuleApiDefine + "=");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// @todo SharedPCH: Public headers included from modules that are not importing the module of that public header, seems invalid.
|
|
// Those public headers have no business having APIs in them. OnlineSubsystem has some public headers like this. Without changing
|
|
// this, we need to suppress warnings at compile time.
|
|
if (bIncludePathsOnly)
|
|
{
|
|
Log.TraceVerbose("{0}: Include paths only for {1} (binary: {2})", SourceBinaryPath.GetFileNameWithoutExtension(), Name, BinaryPath.GetFileNameWithoutExtension());
|
|
Definitions.Add(ModuleApiDefine + "=");
|
|
}
|
|
else if (Binary.Config.bAllowExports)
|
|
{
|
|
Log.TraceVerbose("{0}: Importing {1} from {2}", SourceBinaryPath.GetFileNameWithoutExtension(), Name, BinaryPath.GetFileNameWithoutExtension());
|
|
Definitions.Add(ModuleApiDefine + "=DLLIMPORT");
|
|
}
|
|
else
|
|
{
|
|
Log.TraceVerbose("{0}: Not importing/exporting {1} (binary: {2})", SourceBinaryPath.GetFileNameWithoutExtension(), Name, BinaryPath.GetFileNameWithoutExtension());
|
|
Definitions.Add(ModuleApiDefine + "=");
|
|
}
|
|
}
|
|
}
|
|
|
|
// Add the module's directory to the include path, so we can root #includes to it
|
|
IncludePaths.Add(NormalizedModuleIncludePath);
|
|
|
|
// Add the additional frameworks so that the compiler can know about their #include paths
|
|
AdditionalFrameworks.AddRange(PublicAdditionalFrameworks);
|
|
|
|
// Remember the module so we can refer to it when needed
|
|
foreach (UEBuildFramework Framework in PublicAdditionalFrameworks)
|
|
{
|
|
Framework.OwningModule = this;
|
|
}
|
|
}
|
|
|
|
static Regex VCMacroRegex = new Regex(@"\$\([A-Za-z0-9_]+\)");
|
|
|
|
/// <summary>
|
|
/// Checks if path contains a VC macro
|
|
/// </summary>
|
|
protected bool DoesPathContainVCMacro(string Path)
|
|
{
|
|
return VCMacroRegex.IsMatch(Path);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Adds PathsToAdd to IncludePaths, performing path normalization and ignoring duplicates.
|
|
/// </summary>
|
|
protected void AddIncludePathsWithChecks(HashSet<string> IncludePaths, HashSet<string> PathsToAdd)
|
|
{
|
|
if (ProjectFileGenerator.bGenerateProjectFiles)
|
|
{
|
|
// Extra checks are switched off for IntelliSense generation as they provide
|
|
// no additional value and cause performance impact.
|
|
IncludePaths.UnionWith(PathsToAdd);
|
|
}
|
|
else
|
|
{
|
|
foreach (string Path in PathsToAdd)
|
|
{
|
|
string NormalizedPath = Path.TrimEnd('/');
|
|
// If path doesn't exist, it may contain VC macro (which is passed directly to and expanded by compiler).
|
|
if (Directory.Exists(NormalizedPath) || DoesPathContainVCMacro(NormalizedPath))
|
|
{
|
|
IncludePaths.Add(NormalizedPath);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Sets up the environment for compiling this module.
|
|
/// </summary>
|
|
protected virtual void SetupPrivateCompileEnvironment(
|
|
HashSet<string> IncludePaths,
|
|
HashSet<string> SystemIncludePaths,
|
|
List<string> Definitions,
|
|
List<UEBuildFramework> AdditionalFrameworks
|
|
)
|
|
{
|
|
HashSet<UEBuildModule> VisitedModules = new HashSet<UEBuildModule>();
|
|
|
|
if (this.Type.IsGameModule())
|
|
{
|
|
Definitions.Add("DEPRECATED_FORGAME=DEPRECATED");
|
|
}
|
|
|
|
// Add this module's private include paths and definitions.
|
|
AddIncludePathsWithChecks(IncludePaths, PrivateIncludePaths);
|
|
|
|
// Find all the modules that are part of the public compile environment for this module.
|
|
List<UEBuildModule> Modules = new List<UEBuildModule>();
|
|
Dictionary<UEBuildModule, bool> ModuleToIncludePathsOnlyFlag = new Dictionary<UEBuildModule, bool>();
|
|
FindModulesInPublicCompileEnvironment(Modules, ModuleToIncludePathsOnlyFlag);
|
|
|
|
// Add in all the modules that are private dependencies
|
|
foreach (UEBuildModule DependencyModule in PrivateDependencyModules)
|
|
{
|
|
DependencyModule.FindModulesInPublicCompileEnvironment(Modules, ModuleToIncludePathsOnlyFlag);
|
|
}
|
|
|
|
// And finally add in all the modules that are include path only dependencies
|
|
foreach (UEBuildModule IncludePathModule in PrivateIncludePathModules)
|
|
{
|
|
IncludePathModule.FindIncludePathModulesInPublicCompileEnvironment(Modules, ModuleToIncludePathsOnlyFlag);
|
|
}
|
|
|
|
// Now set up the compile environment for the modules in the original order that we encountered them
|
|
foreach (UEBuildModule Module in Modules)
|
|
{
|
|
Module.AddModuleToCompileEnvironment(Binary, ModuleToIncludePathsOnlyFlag[Module], IncludePaths, SystemIncludePaths, Definitions, AdditionalFrameworks);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Sets up the environment for linking any module that includes the public interface of this module.
|
|
/// </summary>
|
|
protected virtual void SetupPublicLinkEnvironment(
|
|
UEBuildBinary SourceBinary,
|
|
List<string> LibraryPaths,
|
|
List<string> AdditionalLibraries,
|
|
List<string> Frameworks,
|
|
List<string> WeakFrameworks,
|
|
List<UEBuildFramework> AdditionalFrameworks,
|
|
List<string> AdditionalShadowFiles,
|
|
List<UEBuildBundleResource> AdditionalBundleResources,
|
|
List<string> DelayLoadDLLs,
|
|
List<UEBuildBinary> BinaryDependencies,
|
|
HashSet<UEBuildModule> VisitedModules
|
|
)
|
|
{
|
|
// There may be circular dependencies in compile dependencies, so we need to avoid reentrance.
|
|
if (VisitedModules.Add(this))
|
|
{
|
|
// Add this module's binary to the binary dependencies.
|
|
if (Binary != null
|
|
&& Binary != SourceBinary
|
|
&& !BinaryDependencies.Contains(Binary))
|
|
{
|
|
BinaryDependencies.Add(Binary);
|
|
}
|
|
|
|
// If this module belongs to a static library that we are not currently building, recursively add the link environment settings for all of its dependencies too.
|
|
// Keep doing this until we reach a module that is not part of a static library (or external module, since they have no associated binary).
|
|
// Static libraries do not contain the symbols for their dependencies, so we need to recursively gather them to be linked into other binary types.
|
|
bool bIsBuildingAStaticLibrary = (SourceBinary != null && SourceBinary.Config.Type == UEBuildBinaryType.StaticLibrary);
|
|
bool bIsModuleBinaryAStaticLibrary = (Binary != null && Binary.Config.Type == UEBuildBinaryType.StaticLibrary);
|
|
if (!bIsBuildingAStaticLibrary && bIsModuleBinaryAStaticLibrary)
|
|
{
|
|
// Gather all dependencies and recursively call SetupPublicLinkEnvironmnet
|
|
List<UEBuildModule> AllDependencyModules = new List<UEBuildModule>();
|
|
AllDependencyModules.AddRange(PrivateDependencyModules);
|
|
AllDependencyModules.AddRange(PublicDependencyModules);
|
|
|
|
foreach (UEBuildModule DependencyModule in AllDependencyModules)
|
|
{
|
|
bool bIsExternalModule = (DependencyModule as UEBuildExternalModule != null);
|
|
bool bIsInStaticLibrary = (DependencyModule.Binary != null && DependencyModule.Binary.Config.Type == UEBuildBinaryType.StaticLibrary);
|
|
if (bIsExternalModule || bIsInStaticLibrary)
|
|
{
|
|
DependencyModule.SetupPublicLinkEnvironment(SourceBinary, LibraryPaths, AdditionalLibraries, Frameworks, WeakFrameworks,
|
|
AdditionalFrameworks, AdditionalShadowFiles, AdditionalBundleResources, DelayLoadDLLs, BinaryDependencies, VisitedModules);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Add this module's public include library paths and additional libraries.
|
|
LibraryPaths.AddRange(PublicLibraryPaths);
|
|
AdditionalLibraries.AddRange(PublicAdditionalLibraries);
|
|
Frameworks.AddRange(PublicFrameworks);
|
|
WeakFrameworks.AddRange(PublicWeakFrameworks);
|
|
AdditionalBundleResources.AddRange(PublicAdditionalBundleResources);
|
|
// Remember the module so we can refer to it when needed
|
|
foreach (UEBuildFramework Framework in PublicAdditionalFrameworks)
|
|
{
|
|
Framework.OwningModule = this;
|
|
}
|
|
AdditionalFrameworks.AddRange(PublicAdditionalFrameworks);
|
|
AdditionalShadowFiles.AddRange(PublicAdditionalShadowFiles);
|
|
DelayLoadDLLs.AddRange(PublicDelayLoadDLLs);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Sets up the environment for linking this module.
|
|
/// </summary>
|
|
public virtual void SetupPrivateLinkEnvironment(
|
|
UEBuildBinary SourceBinary,
|
|
LinkEnvironment LinkEnvironment,
|
|
List<UEBuildBinary> BinaryDependencies,
|
|
HashSet<UEBuildModule> VisitedModules
|
|
)
|
|
{
|
|
// Allow the module's public dependencies to add library paths and additional libraries to the link environment.
|
|
SetupPublicLinkEnvironment(SourceBinary, LinkEnvironment.Config.LibraryPaths, LinkEnvironment.Config.AdditionalLibraries, LinkEnvironment.Config.Frameworks, LinkEnvironment.Config.WeakFrameworks,
|
|
LinkEnvironment.Config.AdditionalFrameworks, LinkEnvironment.Config.AdditionalShadowFiles, LinkEnvironment.Config.AdditionalBundleResources, LinkEnvironment.Config.DelayLoadDLLs, BinaryDependencies, VisitedModules);
|
|
|
|
// Also allow the module's public and private dependencies to modify the link environment.
|
|
List<UEBuildModule> AllDependencyModules = new List<UEBuildModule>();
|
|
AllDependencyModules.AddRange(PrivateDependencyModules);
|
|
AllDependencyModules.AddRange(PublicDependencyModules);
|
|
|
|
foreach (UEBuildModule DependencyModule in AllDependencyModules)
|
|
{
|
|
DependencyModule.SetupPublicLinkEnvironment(SourceBinary, LinkEnvironment.Config.LibraryPaths, LinkEnvironment.Config.AdditionalLibraries, LinkEnvironment.Config.Frameworks, LinkEnvironment.Config.WeakFrameworks,
|
|
LinkEnvironment.Config.AdditionalFrameworks, LinkEnvironment.Config.AdditionalShadowFiles, LinkEnvironment.Config.AdditionalBundleResources, LinkEnvironment.Config.DelayLoadDLLs, BinaryDependencies, VisitedModules);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Compiles the module, and returns a list of files output by the compiler.
|
|
/// </summary>
|
|
public abstract List<FileItem> Compile(UEBuildTarget Target, UEToolChain ToolChain, CPPEnvironment GlobalCompileEnvironment, CPPEnvironment CompileEnvironment);
|
|
|
|
// Object interface.
|
|
public override string ToString()
|
|
{
|
|
return Name;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Finds the modules referenced by this module which have not yet been bound to a binary
|
|
/// </summary>
|
|
/// <returns>List of unbound modules</returns>
|
|
public List<UEBuildModule> GetUnboundReferences()
|
|
{
|
|
List<UEBuildModule> Modules = new List<UEBuildModule>();
|
|
Modules.AddRange(PrivateDependencyModules.Where(x => x.Binary == null));
|
|
Modules.AddRange(PublicDependencyModules.Where(x => x.Binary == null));
|
|
return Modules;
|
|
}
|
|
|
|
[DebuggerDisplay("{Index}: {Module}")]
|
|
public class ModuleIndexPair
|
|
{
|
|
public UEBuildModule Module;
|
|
public int Index;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets all of the modules referenced by this module
|
|
/// </summary>
|
|
/// <param name="ReferencedModules">Hash of all referenced modules with their addition index.</param>
|
|
/// <param name="IgnoreReferencedModules">Hashset used to ignore modules which are already added to the list</param>
|
|
/// <param name="bIncludeDynamicallyLoaded">True if dynamically loaded modules (and all of their dependent modules) should be included.</param>
|
|
/// <param name="bForceCircular">True if circular dependencies should be processed</param>
|
|
/// <param name="bOnlyDirectDependencies">True to return only this module's direct dependencies</param>
|
|
public virtual void GetAllDependencyModules(List<UEBuildModule> ReferencedModules, HashSet<UEBuildModule> IgnoreReferencedModules, bool bIncludeDynamicallyLoaded, bool bForceCircular, bool bOnlyDirectDependencies)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets all of the modules precompiled along with this module
|
|
/// </summary>
|
|
/// <param name="Modules">Set of all the precompiled modules</param>
|
|
public virtual void RecursivelyAddPrecompiledModules(List<UEBuildModule> Modules)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Creates all the modules required for this target
|
|
/// </summary>
|
|
public void RecursivelyCreateModules(UEBuildTarget Target)
|
|
{
|
|
// Create all the include path modules. These modules may not be added to the target (and we don't process their dependencies), but they need
|
|
// to be created to set up their compile environment.
|
|
RecursivelyCreateIncludePathModulesByName(Target, Rules.PublicIncludePathModuleNames, ref PublicIncludePathModules);
|
|
RecursivelyCreateIncludePathModulesByName(Target, Rules.PrivateIncludePathModuleNames, ref PrivateIncludePathModules);
|
|
|
|
// Create all the dependency modules
|
|
RecursivelyCreateModulesByName(Target, Rules.PublicDependencyModuleNames, ref PublicDependencyModules);
|
|
RecursivelyCreateModulesByName(Target, Rules.PrivateDependencyModuleNames, ref PrivateDependencyModules);
|
|
RecursivelyCreateModulesByName(Target, Rules.DynamicallyLoadedModuleNames, ref DynamicallyLoadedModules);
|
|
RecursivelyCreateModulesByName(Target, Rules.PlatformSpecificDynamicallyLoadedModuleNames, ref PlatformSpecificDynamicallyLoadedModules);
|
|
}
|
|
|
|
private static void RecursivelyCreateModulesByName(UEBuildTarget Target, List<string> ModuleNames, ref List<UEBuildModule> Modules)
|
|
{
|
|
// Check whether the module list is already set. We set this immediately (via the ref) to avoid infinite recursion.
|
|
if (Modules == null)
|
|
{
|
|
Modules = new List<UEBuildModule>();
|
|
foreach (string ModuleName in ModuleNames)
|
|
{
|
|
UEBuildModule Module = Target.FindOrCreateModuleByName(ModuleName);
|
|
if (!Modules.Contains(Module))
|
|
{
|
|
Module.RecursivelyCreateModules(Target);
|
|
Modules.Add(Module);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private static void RecursivelyCreateIncludePathModulesByName(UEBuildTarget Target, List<string> ModuleNames, ref List<UEBuildModule> Modules)
|
|
{
|
|
// Check whether the module list is already set. We set this immediately (via the ref) to avoid infinite recursion.
|
|
if (Modules == null)
|
|
{
|
|
Modules = new List<UEBuildModule>();
|
|
foreach (string ModuleName in ModuleNames)
|
|
{
|
|
UEBuildModule Module = Target.FindOrCreateModuleByName(ModuleName);
|
|
RecursivelyCreateIncludePathModulesByName(Target, Module.Rules.PublicIncludePathModuleNames, ref Module.PublicIncludePathModules);
|
|
Modules.Add(Module);
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
/// <summary>
|
|
/// A module that is never compiled by us, and is only used to group include paths and libraries into a dependency unit.
|
|
/// </summary>
|
|
class UEBuildExternalModule : UEBuildModule
|
|
{
|
|
public UEBuildExternalModule(
|
|
UHTModuleType InType,
|
|
string InName,
|
|
DirectoryReference InModuleDirectory,
|
|
ModuleRules InRules,
|
|
FileReference InRulesFile
|
|
)
|
|
: base(
|
|
InType: InType,
|
|
InName: InName,
|
|
InModuleDirectory: InModuleDirectory,
|
|
InRules: InRules,
|
|
InRulesFile: InRulesFile
|
|
)
|
|
{
|
|
}
|
|
|
|
// UEBuildModule interface.
|
|
public override List<FileItem> Compile(UEBuildTarget Target, UEToolChain ToolChain, CPPEnvironment GlobalCompileEnvironment, CPPEnvironment CompileEnvironment)
|
|
{
|
|
return new List<FileItem>();
|
|
}
|
|
};
|
|
|
|
/// <summary>
|
|
/// A module that is compiled from C++ code.
|
|
/// </summary>
|
|
public class UEBuildModuleCPP : UEBuildModule
|
|
{
|
|
public class AutoGenerateCppInfoClass
|
|
{
|
|
public class BuildInfoClass
|
|
{
|
|
/// <summary>
|
|
/// The wildcard of the *.generated.cpp file which was generated for the module
|
|
/// </summary>
|
|
public readonly string FileWildcard;
|
|
|
|
public BuildInfoClass(string InWildcard)
|
|
{
|
|
Debug.Assert(InWildcard != null);
|
|
|
|
FileWildcard = InWildcard;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Information about how to build the .generated.cpp files. If this is null, then we're not building .generated.cpp files for this module.
|
|
/// </summary>
|
|
public BuildInfoClass BuildInfo;
|
|
|
|
public AutoGenerateCppInfoClass(BuildInfoClass InBuildInfo)
|
|
{
|
|
BuildInfo = InBuildInfo;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Information about the .generated.cpp file. If this is null then this module doesn't have any UHT-produced code.
|
|
/// </summary>
|
|
public AutoGenerateCppInfoClass AutoGenerateCppInfo = null;
|
|
|
|
public class SourceFilesClass
|
|
{
|
|
public readonly List<FileItem> MissingFiles = new List<FileItem>();
|
|
public readonly List<FileItem> CPPFiles = new List<FileItem>();
|
|
public readonly List<FileItem> CFiles = new List<FileItem>();
|
|
public readonly List<FileItem> CCFiles = new List<FileItem>();
|
|
public readonly List<FileItem> MMFiles = new List<FileItem>();
|
|
public readonly List<FileItem> RCFiles = new List<FileItem>();
|
|
public readonly List<FileItem> OtherFiles = new List<FileItem>();
|
|
|
|
public int Count
|
|
{
|
|
get
|
|
{
|
|
return MissingFiles.Count +
|
|
CPPFiles.Count +
|
|
CFiles.Count +
|
|
CCFiles.Count +
|
|
MMFiles.Count +
|
|
RCFiles.Count +
|
|
OtherFiles.Count;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Copy from list to list helper.
|
|
/// </summary>
|
|
/// <param name="From">Source list.</param>
|
|
/// <param name="To">Destination list.</param>
|
|
private static void CopyFromListToList(List<FileItem> From, List<FileItem> To)
|
|
{
|
|
To.Clear();
|
|
To.AddRange(From);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Copies file lists from other SourceFilesClass to this.
|
|
/// </summary>
|
|
/// <param name="Other">Source object.</param>
|
|
public void CopyFrom(SourceFilesClass Other)
|
|
{
|
|
CopyFromListToList(Other.MissingFiles, MissingFiles);
|
|
CopyFromListToList(Other.CPPFiles, CPPFiles);
|
|
CopyFromListToList(Other.CFiles, CFiles);
|
|
CopyFromListToList(Other.CCFiles, CCFiles);
|
|
CopyFromListToList(Other.MMFiles, MMFiles);
|
|
CopyFromListToList(Other.RCFiles, RCFiles);
|
|
CopyFromListToList(Other.OtherFiles, OtherFiles);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Adds additional source cpp files for this module.
|
|
/// </summary>
|
|
/// <param name="Files">Files to add.</param>
|
|
public void AddAdditionalCPPFiles(IEnumerable<FileItem> Files)
|
|
{
|
|
SourceFilesToBuild.CPPFiles.AddRange(Files);
|
|
}
|
|
|
|
/// <summary>
|
|
/// A list of the absolute paths of source files to be built in this module.
|
|
/// </summary>
|
|
public readonly SourceFilesClass SourceFilesToBuild = new SourceFilesClass();
|
|
|
|
/// <summary>
|
|
/// A list of the source files that were found for the module.
|
|
/// </summary>
|
|
public readonly SourceFilesClass SourceFilesFound = new SourceFilesClass();
|
|
|
|
/// <summary>
|
|
/// The directory for this module's generated code
|
|
/// </summary>
|
|
public readonly DirectoryReference GeneratedCodeDirectory;
|
|
|
|
/// <summary>
|
|
/// The preprocessor definitions used to compile this module's private implementation.
|
|
/// </summary>
|
|
HashSet<string> Definitions;
|
|
|
|
/// When set, allows this module to report compiler definitions and include paths for Intellisense
|
|
IntelliSenseGatherer IntelliSenseGatherer;
|
|
|
|
public List<string> IncludeSearchPaths = new List<string>();
|
|
|
|
public class ProcessedDependenciesClass
|
|
{
|
|
/// <summary>
|
|
/// The file, if any, which is used as the unique PCH for this module
|
|
/// </summary>
|
|
public FileItem UniquePCHHeaderFile = null;
|
|
}
|
|
|
|
/// <summary>
|
|
/// The processed dependencies for the class
|
|
/// </summary>
|
|
public ProcessedDependenciesClass ProcessedDependencies = null;
|
|
|
|
/// <summary>
|
|
/// Hack to skip adding definitions to compile environment. They will be baked into source code by external code.
|
|
/// </summary>
|
|
public bool bSkipDefinitionsForCompileEnvironment = false;
|
|
|
|
public int FindNumberOfGeneratedCppFiles()
|
|
{
|
|
return ((null == GeneratedCodeDirectory) || !GeneratedCodeDirectory.Exists()) ? 0
|
|
: (GeneratedCodeDirectory.EnumerateFileReferences("*.generated.*.cpp", SearchOption.AllDirectories).Count()
|
|
+ GeneratedCodeDirectory.EnumerateFileReferences("*.generated.cpp", SearchOption.AllDirectories).Count());
|
|
}
|
|
|
|
/// <summary>
|
|
/// Categorizes source files into per-extension buckets
|
|
/// </summary>
|
|
private static void CategorizeSourceFiles(IEnumerable<FileItem> InSourceFiles, SourceFilesClass OutSourceFiles)
|
|
{
|
|
foreach (FileItem SourceFile in InSourceFiles)
|
|
{
|
|
string Extension = Path.GetExtension(SourceFile.AbsolutePath).ToUpperInvariant();
|
|
if (!SourceFile.bExists)
|
|
{
|
|
OutSourceFiles.MissingFiles.Add(SourceFile);
|
|
}
|
|
else if (Extension == ".CPP")
|
|
{
|
|
OutSourceFiles.CPPFiles.Add(SourceFile);
|
|
}
|
|
else if (Extension == ".C")
|
|
{
|
|
OutSourceFiles.CFiles.Add(SourceFile);
|
|
}
|
|
else if (Extension == ".CC")
|
|
{
|
|
OutSourceFiles.CCFiles.Add(SourceFile);
|
|
}
|
|
else if (Extension == ".MM" || Extension == ".M")
|
|
{
|
|
OutSourceFiles.MMFiles.Add(SourceFile);
|
|
}
|
|
else if (Extension == ".RC")
|
|
{
|
|
OutSourceFiles.RCFiles.Add(SourceFile);
|
|
}
|
|
else
|
|
{
|
|
OutSourceFiles.OtherFiles.Add(SourceFile);
|
|
}
|
|
}
|
|
}
|
|
|
|
public UEBuildModuleCPP(
|
|
string InName,
|
|
UHTModuleType InType,
|
|
DirectoryReference InModuleDirectory,
|
|
DirectoryReference InGeneratedCodeDirectory,
|
|
IntelliSenseGatherer InIntelliSenseGatherer,
|
|
IEnumerable<FileItem> InSourceFiles,
|
|
ModuleRules InRules,
|
|
bool bInBuildSourceFiles,
|
|
FileReference InRulesFile
|
|
)
|
|
: base(
|
|
InName,
|
|
InType,
|
|
InModuleDirectory,
|
|
InRules,
|
|
InRulesFile
|
|
)
|
|
{
|
|
GeneratedCodeDirectory = InGeneratedCodeDirectory;
|
|
IntelliSenseGatherer = InIntelliSenseGatherer;
|
|
|
|
CategorizeSourceFiles(InSourceFiles, SourceFilesFound);
|
|
if (bInBuildSourceFiles)
|
|
{
|
|
SourceFilesToBuild.CopyFrom(SourceFilesFound);
|
|
}
|
|
|
|
Definitions = HashSetFromOptionalEnumerableStringParameter(InRules.Definitions);
|
|
foreach (string Def in Definitions)
|
|
{
|
|
Log.TraceVerbose("Compile Env {0}: {1}", Name, Def);
|
|
}
|
|
}
|
|
|
|
// UEBuildModule interface.
|
|
public override List<FileItem> Compile(UEBuildTarget Target, UEToolChain ToolChain, CPPEnvironment GlobalCompileEnvironment, CPPEnvironment CompileEnvironment)
|
|
{
|
|
UEBuildPlatform BuildPlatform = UEBuildPlatform.GetBuildPlatformForCPPTargetPlatform(CompileEnvironment.Config.Target.Platform);
|
|
|
|
List<FileItem> LinkInputFiles = new List<FileItem>();
|
|
if (ProjectFileGenerator.bGenerateProjectFiles && IntelliSenseGatherer == null)
|
|
{
|
|
// Nothing to do for IntelliSense, bail out early
|
|
return LinkInputFiles;
|
|
}
|
|
|
|
CPPEnvironment ModuleCompileEnvironment = CreateModuleCompileEnvironment(Target, CompileEnvironment);
|
|
IncludeSearchPaths = ModuleCompileEnvironment.Config.CPPIncludeInfo.IncludePaths.ToList();
|
|
IncludeSearchPaths.AddRange(ModuleCompileEnvironment.Config.CPPIncludeInfo.SystemIncludePaths.ToList());
|
|
|
|
if (IntelliSenseGatherer != null)
|
|
{
|
|
// Update project file's set of preprocessor definitions and include paths
|
|
IntelliSenseGatherer.AddIntelliSensePreprocessorDefinitions(ModuleCompileEnvironment.Config.Definitions);
|
|
IntelliSenseGatherer.AddInteliiSenseIncludePaths(ModuleCompileEnvironment.Config.CPPIncludeInfo.SystemIncludePaths, bAddingSystemIncludes: true);
|
|
IntelliSenseGatherer.AddInteliiSenseIncludePaths(ModuleCompileEnvironment.Config.CPPIncludeInfo.IncludePaths, bAddingSystemIncludes: false);
|
|
|
|
// Bail out. We don't need to actually compile anything while generating project files.
|
|
return LinkInputFiles;
|
|
}
|
|
|
|
// Throw an error if the module's source file list referenced any non-existent files.
|
|
if (SourceFilesToBuild.MissingFiles.Count > 0)
|
|
{
|
|
throw new BuildException(
|
|
"UBT ERROR: Module \"{0}\" references non-existent files:\n{1} (perhaps a file was added to the project but not checked in)",
|
|
Name,
|
|
string.Join("\n", SourceFilesToBuild.MissingFiles.Select(M => M.AbsolutePath))
|
|
);
|
|
}
|
|
|
|
// For an executable or a static library do not use the default RC file -
|
|
// If the executable wants it, it will be in their source list anyway.
|
|
// The issue here is that when making a monolithic game, the processing
|
|
// of the other game modules will stomp the game-specific rc file.
|
|
if (Binary.Config.Type == UEBuildBinaryType.DynamicLinkLibrary)
|
|
{
|
|
// Add default PCLaunch.rc file if this module has no own resource file specified
|
|
if (SourceFilesToBuild.RCFiles.Count <= 0)
|
|
{
|
|
FileReference DefRC = FileReference.Combine(UnrealBuildTool.EngineSourceDirectory, "Runtime", "Launch", "Resources", "Windows", "PCLaunch.rc");
|
|
FileItem Item = FileItem.GetItemByFileReference(DefRC);
|
|
SourceFilesToBuild.RCFiles.Add(Item);
|
|
}
|
|
|
|
// Always compile in the API version resource separately. This is required for the module manager to detect compatible API versions.
|
|
FileReference ModuleVersionRC = FileReference.Combine(UnrealBuildTool.EngineSourceDirectory, "Runtime", "Core", "Resources", "Windows", "ModuleVersionResource.rc.inl");
|
|
FileItem ModuleVersionItem = FileItem.GetItemByFileReference(ModuleVersionRC);
|
|
if (!SourceFilesToBuild.RCFiles.Contains(ModuleVersionItem))
|
|
{
|
|
SourceFilesToBuild.RCFiles.Add(ModuleVersionItem);
|
|
}
|
|
}
|
|
|
|
|
|
{
|
|
// Process all of the header file dependencies for this module
|
|
this.CachePCHUsageForModuleSourceFiles(Target, ModuleCompileEnvironment);
|
|
|
|
// Make sure our RC files have cached includes.
|
|
foreach (FileItem RCFile in SourceFilesToBuild.RCFiles)
|
|
{
|
|
RCFile.CachedCPPIncludeInfo = ModuleCompileEnvironment.Config.CPPIncludeInfo;
|
|
}
|
|
}
|
|
|
|
|
|
// Check to see if this is an Engine module (including program or plugin modules). That is, the module is located under the "Engine" folder
|
|
bool IsPluginModule = ModuleDirectory.IsUnderDirectory(DirectoryReference.Combine(Target.ProjectDirectory, "Plugins"));
|
|
bool IsGameModule = !IsPluginModule && !ModuleDirectory.IsUnderDirectory(UnrealBuildTool.EngineDirectory);
|
|
|
|
// Should we force a precompiled header to be generated for this module? Usually, we only bother with a
|
|
// precompiled header if there are at least several source files in the module (after combining them for unity
|
|
// builds.) But for game modules, it can be convenient to always have a precompiled header to single-file
|
|
// changes to code is really quick to compile.
|
|
int MinFilesUsingPrecompiledHeader = BuildConfiguration.MinFilesUsingPrecompiledHeader;
|
|
if (Rules.MinFilesUsingPrecompiledHeaderOverride != 0)
|
|
{
|
|
MinFilesUsingPrecompiledHeader = Rules.MinFilesUsingPrecompiledHeaderOverride;
|
|
}
|
|
else if (IsGameModule && BuildConfiguration.bForcePrecompiledHeaderForGameModules)
|
|
{
|
|
// This is a game module with only a small number of source files, so go ahead and force a precompiled header
|
|
// to be generated to make incremental changes to source files as fast as possible for small projects.
|
|
MinFilesUsingPrecompiledHeader = 1;
|
|
}
|
|
|
|
|
|
// Engine modules will always use unity build mode unless MinSourceFilesForUnityBuildOverride is specified in
|
|
// the module rules file. By default, game modules only use unity of they have enough source files for that
|
|
// to be worthwhile. If you have a lot of small game modules, consider specifying MinSourceFilesForUnityBuildOverride=0
|
|
// in the modules that you don't typically iterate on source files in very frequently.
|
|
int MinSourceFilesForUnityBuild = 0;
|
|
if (Rules.MinSourceFilesForUnityBuildOverride != 0)
|
|
{
|
|
MinSourceFilesForUnityBuild = Rules.MinSourceFilesForUnityBuildOverride;
|
|
}
|
|
else if (IsGameModule)
|
|
{
|
|
// Game modules with only a small number of source files are usually better off having faster iteration times
|
|
// on single source file changes, so we forcibly disable unity build for those modules
|
|
MinSourceFilesForUnityBuild = BuildConfiguration.MinGameModuleSourceFilesForUnityBuild;
|
|
}
|
|
|
|
|
|
// Should we use unity build mode for this module?
|
|
bool bModuleUsesUnityBuild = false;
|
|
if (BuildConfiguration.bUseUnityBuild || BuildConfiguration.bForceUnityBuild)
|
|
{
|
|
if (BuildConfiguration.bForceUnityBuild)
|
|
{
|
|
Log.TraceVerbose("Module '{0}' using unity build mode (bForceUnityBuild enabled for this module)", this.Name);
|
|
bModuleUsesUnityBuild = true;
|
|
}
|
|
else if (Rules.bFasterWithoutUnity)
|
|
{
|
|
Log.TraceVerbose("Module '{0}' not using unity build mode (bFasterWithoutUnity enabled for this module)", this.Name);
|
|
bModuleUsesUnityBuild = false;
|
|
}
|
|
else if (SourceFilesToBuild.CPPFiles.Count < MinSourceFilesForUnityBuild)
|
|
{
|
|
Log.TraceVerbose("Module '{0}' not using unity build mode (module with fewer than {1} source files)", this.Name, MinSourceFilesForUnityBuild);
|
|
bModuleUsesUnityBuild = false;
|
|
}
|
|
else
|
|
{
|
|
Log.TraceVerbose("Module '{0}' using unity build mode (enabled in BuildConfiguration)", this.Name);
|
|
bModuleUsesUnityBuild = true;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Log.TraceVerbose("Module '{0}' not using unity build mode (disabled in BuildConfiguration)", this.Name);
|
|
}
|
|
|
|
// The environment with which to compile the CPP files
|
|
CPPEnvironment CPPCompileEnvironment = ModuleCompileEnvironment;
|
|
|
|
// Precompiled header support.
|
|
bool bWasModuleCodeCompiled = false;
|
|
if (BuildPlatform.ShouldUsePCHFiles(CompileEnvironment.Config.Target.Platform, CompileEnvironment.Config.Target.Configuration))
|
|
{
|
|
DateTime PCHGenTimerStart = DateTime.UtcNow;
|
|
|
|
// The code below will figure out whether this module will either use a "unique PCH" (private PCH that will only be included by
|
|
// this module's code files), or a "shared PCH" (potentially included by many code files in many modules.) Only one or the other
|
|
// will be used.
|
|
FileItem SharedPCHHeaderFile = null;
|
|
|
|
// In the case of a shared PCH, we also need to keep track of which module that PCH's header file is a member of
|
|
string SharedPCHModuleName = String.Empty;
|
|
|
|
if (BuildConfiguration.bUseSharedPCHs && CompileEnvironment.Config.bIsBuildingLibrary)
|
|
{
|
|
Log.TraceVerbose("Module '{0}' was not allowed to use Shared PCHs, because we're compiling to a library", this.Name);
|
|
}
|
|
|
|
bool bUseSharedPCHFiles = BuildConfiguration.bUseSharedPCHs && !CompileEnvironment.Config.bIsBuildingLibrary && GlobalCompileEnvironment.SharedPCHHeaderFiles.Count > 0;
|
|
|
|
if (bUseSharedPCHFiles)
|
|
{
|
|
FileReference SharingPCHHeaderFilePath = null;
|
|
bool bIsASharedPCHModule = bUseSharedPCHFiles && GlobalCompileEnvironment.SharedPCHHeaderFiles.Any(PCH => PCH.Module == this);
|
|
if (bIsASharedPCHModule)
|
|
{
|
|
SharingPCHHeaderFilePath = FileReference.Combine(UnrealBuildTool.EngineSourceDirectory, Rules.SharedPCHHeaderFile);
|
|
}
|
|
|
|
// We can't use a shared PCH file when compiling a module
|
|
// with exports, because the shared PCH can only have imports in it to work correctly.
|
|
bool bAllowSharedPCH = (Rules.PCHUsage == ModuleRules.PCHUsageMode.NoSharedPCHs) ? false : true;
|
|
bool bCanModuleUseOwnSharedPCH = bAllowSharedPCH && bIsASharedPCHModule && !Binary.Config.bAllowExports && ProcessedDependencies.UniquePCHHeaderFile.Reference == SharingPCHHeaderFilePath;
|
|
if (bAllowSharedPCH && (!bIsASharedPCHModule || bCanModuleUseOwnSharedPCH))
|
|
{
|
|
// Figure out which shared PCH tier we're in
|
|
List<UEBuildModule> ReferencedModules = new List<UEBuildModule>();
|
|
{
|
|
this.GetAllDependencyModules(ReferencedModules, new HashSet<UEBuildModule>(), bIncludeDynamicallyLoaded: false, bForceCircular: false, bOnlyDirectDependencies: true);
|
|
}
|
|
|
|
int LargestSharedPCHHeaderFileIndex = -1;
|
|
foreach (UEBuildModule DependencyModule in ReferencedModules)
|
|
{
|
|
// These Shared PCHs are ordered from least complex to most complex. We'll start at the last one and search backwards.
|
|
for (int SharedPCHHeaderFileIndex = GlobalCompileEnvironment.SharedPCHHeaderFiles.Count - 1; SharedPCHHeaderFileIndex > LargestSharedPCHHeaderFileIndex; --SharedPCHHeaderFileIndex)
|
|
{
|
|
SharedPCHHeaderInfo CurSharedPCHHeaderFile = GlobalCompileEnvironment.SharedPCHHeaderFiles[SharedPCHHeaderFileIndex];
|
|
|
|
if (DependencyModule == CurSharedPCHHeaderFile.Module ||
|
|
(bIsASharedPCHModule && CurSharedPCHHeaderFile.Module == this)) // If we ourselves are a shared PCH module, always at least use our own module as our shared PCH header if we can't find anything better
|
|
{
|
|
SharedPCHModuleName = CurSharedPCHHeaderFile.Module.Name;
|
|
SharedPCHHeaderFile = CurSharedPCHHeaderFile.PCHHeaderFile;
|
|
LargestSharedPCHHeaderFileIndex = SharedPCHHeaderFileIndex;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (LargestSharedPCHHeaderFileIndex == GlobalCompileEnvironment.SharedPCHHeaderFiles.Count - 1)
|
|
{
|
|
// We've determined that the module is using our most complex PCH header, so we can early-out
|
|
break;
|
|
}
|
|
}
|
|
|
|
// Did we not find a shared PCH header that is being included by this module? This could happen if the module is not including Core.h, even indirectly.
|
|
if (String.IsNullOrEmpty(SharedPCHModuleName))
|
|
{
|
|
throw new BuildException("Module {0} doesn't use a Shared PCH! Please add a dependency on a Shared PCH module to this module's dependency list", this.Name);
|
|
}
|
|
|
|
// Keep track of how many modules make use of this PCH for performance diagnostics
|
|
SharedPCHHeaderInfo LargestSharedPCHHeader = GlobalCompileEnvironment.SharedPCHHeaderFiles[LargestSharedPCHHeaderFileIndex];
|
|
++LargestSharedPCHHeader.NumModulesUsingThisPCH;
|
|
|
|
// Don't allow game modules to use engine PCHs in DebugGame - the optimization settings aren't correct.
|
|
// @todo: we should be creating shared PCHs ahead of time, and only using them if our settings match. as it is, the first modules compiled
|
|
// (which are currently plugins) get to call the shots for how the shared PCH gets built, and that might be a game plugin built in debug...
|
|
if (Target.Configuration == UnrealTargetConfiguration.DebugGame && SharedPCHHeaderFile.Reference.IsUnderDirectory(UnrealBuildTool.EngineDirectory) && !RulesFile.IsUnderDirectory(UnrealBuildTool.EngineDirectory))
|
|
{
|
|
SharedPCHModuleName = null;
|
|
SharedPCHHeaderFile = null;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Log.TraceVerbose("Module '{0}' cannot create or use Shared PCHs, because it needs its own private PCH", this.Name);
|
|
}
|
|
}
|
|
|
|
|
|
// The precompiled header environment for all source files in this module that use a precompiled header, if we even need one
|
|
PrecompileHeaderEnvironment ModulePCHEnvironment = null;
|
|
|
|
// If there was one header that was included first by enough C++ files, use it as the precompiled header.
|
|
// Only use precompiled headers for projects with enough files to make the PCH creation worthwhile.
|
|
if (SharedPCHHeaderFile != null || SourceFilesToBuild.CPPFiles.Count >= MinFilesUsingPrecompiledHeader)
|
|
{
|
|
FileItem PCHToUse;
|
|
|
|
if (SharedPCHHeaderFile != null)
|
|
{
|
|
ModulePCHEnvironment = ApplySharedPCH(GlobalCompileEnvironment, CompileEnvironment, ModuleCompileEnvironment, SourceFilesToBuild.CPPFiles, ref SharedPCHHeaderFile);
|
|
if (ModulePCHEnvironment != null)
|
|
{
|
|
// @todo SharedPCH: Ideally we would exhaustively check for a compatible compile environment (definitions, imports/exports, etc)
|
|
// Currently, it's possible for the shared PCH to be compiled differently depending on which module UBT happened to have
|
|
// include it first during the build phase. This could create problems with deterministic builds, or turn up compile
|
|
// errors unexpectedly due to compile environment differences.
|
|
Log.TraceVerbose("Module " + Name + " uses existing Shared PCH '" + ModulePCHEnvironment.PrecompiledHeaderIncludeFilename + "' (from module " + ModulePCHEnvironment.ModuleName + ")");
|
|
}
|
|
|
|
PCHToUse = SharedPCHHeaderFile;
|
|
}
|
|
else
|
|
{
|
|
PCHToUse = ProcessedDependencies.UniquePCHHeaderFile;
|
|
}
|
|
|
|
if (PCHToUse != null)
|
|
{
|
|
// Update all CPPFiles to point to the PCH
|
|
foreach (FileItem CPPFile in SourceFilesToBuild.CPPFiles)
|
|
{
|
|
CPPFile.PCHHeaderNameInCode = PCHToUse.AbsolutePath;
|
|
CPPFile.PrecompiledHeaderIncludeFilename = PCHToUse.Reference;
|
|
}
|
|
}
|
|
|
|
// A shared PCH was not already set up for us, so set one up.
|
|
if (ModulePCHEnvironment == null && SourceFilesToBuild.CPPFiles.Count > 0)
|
|
{
|
|
FileItem PCHHeaderFile = ProcessedDependencies.UniquePCHHeaderFile;
|
|
string PCHModuleName = this.Name;
|
|
if (SharedPCHHeaderFile != null)
|
|
{
|
|
PCHHeaderFile = SharedPCHHeaderFile;
|
|
PCHModuleName = SharedPCHModuleName;
|
|
}
|
|
string PCHHeaderNameInCode = SourceFilesToBuild.CPPFiles[0].PCHHeaderNameInCode;
|
|
|
|
ModulePCHEnvironment = new PrecompileHeaderEnvironment(PCHModuleName, PCHHeaderNameInCode, PCHHeaderFile, ModuleCompileEnvironment.Config.CLRMode, ModuleCompileEnvironment.Config.OptimizeCode);
|
|
|
|
if (SharedPCHHeaderFile != null)
|
|
{
|
|
// Add to list of shared PCH environments
|
|
GlobalCompileEnvironment.SharedPCHEnvironments.Add(ModulePCHEnvironment);
|
|
Log.TraceVerbose("Module " + Name + " uses new Shared PCH '" + ModulePCHEnvironment.PrecompiledHeaderIncludeFilename + "'");
|
|
}
|
|
else
|
|
{
|
|
Log.TraceVerbose("Module " + Name + " uses a Unique PCH '" + ModulePCHEnvironment.PrecompiledHeaderIncludeFilename + "'");
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Log.TraceVerbose("Module " + Name + " doesn't use a Shared PCH, and only has " + SourceFilesToBuild.CPPFiles.Count.ToString() + " source file(s). No Unique PCH will be generated.");
|
|
}
|
|
|
|
// Compile the C++ source or the unity C++ files that use a PCH environment.
|
|
if (ModulePCHEnvironment != null)
|
|
{
|
|
// Setup a new compile environment for this module's source files. It's pretty much the exact same as the
|
|
// module's compile environment, except that it will include a PCH file.
|
|
|
|
CPPEnvironment ModulePCHCompileEnvironment = ModuleCompileEnvironment.DeepCopy();
|
|
ModulePCHCompileEnvironment.Config.PrecompiledHeaderAction = PrecompiledHeaderAction.Include;
|
|
ModulePCHCompileEnvironment.Config.PrecompiledHeaderIncludeFilename = ModulePCHEnvironment.PrecompiledHeaderIncludeFilename.Reference;
|
|
ModulePCHCompileEnvironment.Config.PCHHeaderNameInCode = ModulePCHEnvironment.PCHHeaderNameInCode;
|
|
|
|
if (SharedPCHHeaderFile != null)
|
|
{
|
|
// Shared PCH headers need to be force included, because we're basically forcing the module to use
|
|
// the precompiled header that we want, instead of the "first include" in each respective .cpp file
|
|
ModulePCHCompileEnvironment.Config.bForceIncludePrecompiledHeader = true;
|
|
}
|
|
|
|
List<FileItem> CPPFilesToBuild = SourceFilesToBuild.CPPFiles;
|
|
if (bModuleUsesUnityBuild)
|
|
{
|
|
// unity files generated for only the set of files which share the same PCH environment
|
|
CPPFilesToBuild = Unity.GenerateUnityCPPs(ToolChain, Target, CPPFilesToBuild, ModulePCHCompileEnvironment, Name);
|
|
}
|
|
|
|
// Check if there are enough unity files to warrant pch generation (and we haven't already generated the shared one)
|
|
if (ModulePCHEnvironment.PrecompiledHeaderFile == null)
|
|
{
|
|
if (SharedPCHHeaderFile != null || CPPFilesToBuild.Count >= MinFilesUsingPrecompiledHeader)
|
|
{
|
|
CPPOutput PCHOutput;
|
|
if (SharedPCHHeaderFile == null)
|
|
{
|
|
PCHOutput = PrecompileHeaderEnvironment.GeneratePCHCreationAction(
|
|
ToolChain,
|
|
Target,
|
|
CPPFilesToBuild[0].PCHHeaderNameInCode,
|
|
ModulePCHEnvironment.PrecompiledHeaderIncludeFilename,
|
|
ModuleCompileEnvironment,
|
|
ModuleCompileEnvironment.Config.OutputDirectory,
|
|
ModuleCompileEnvironment.Config.PCHOutputDirectory,
|
|
Name,
|
|
true);
|
|
}
|
|
else
|
|
{
|
|
UEBuildModuleCPP SharedPCHModule = (UEBuildModuleCPP)Target.FindOrCreateModuleByName(SharedPCHModuleName);
|
|
|
|
CPPEnvironment SharedPCHCompileEnvironment = GlobalCompileEnvironment.DeepCopy();
|
|
SharedPCHCompileEnvironment.Config.bEnableShadowVariableWarning = SharedPCHModule.Rules.bEnableShadowVariableWarnings;
|
|
|
|
List<UEBuildModule> Modules = new List<UEBuildModule>();
|
|
Dictionary<UEBuildModule, bool> ModuleToIncludePathsOnlyFlag = new Dictionary<UEBuildModule, bool>();
|
|
SharedPCHModule.FindModulesInPublicCompileEnvironment(Modules, ModuleToIncludePathsOnlyFlag);
|
|
|
|
foreach (UEBuildModule Module in Modules)
|
|
{
|
|
Module.AddModuleToCompileEnvironment(
|
|
Binary,
|
|
ModuleToIncludePathsOnlyFlag[Module],
|
|
SharedPCHCompileEnvironment.Config.CPPIncludeInfo.IncludePaths,
|
|
SharedPCHCompileEnvironment.Config.CPPIncludeInfo.SystemIncludePaths,
|
|
SharedPCHCompileEnvironment.Config.Definitions,
|
|
SharedPCHCompileEnvironment.Config.AdditionalFrameworks);
|
|
}
|
|
|
|
PCHOutput = PrecompileHeaderEnvironment.GeneratePCHCreationAction(
|
|
ToolChain,
|
|
Target,
|
|
CPPFilesToBuild[0].PCHHeaderNameInCode,
|
|
ModulePCHEnvironment.PrecompiledHeaderIncludeFilename,
|
|
SharedPCHCompileEnvironment,
|
|
DirectoryReference.Combine(CompileEnvironment.Config.OutputDirectory, "SharedPCHs"),
|
|
(CompileEnvironment.Config.PCHOutputDirectory == null) ? null : DirectoryReference.Combine(CompileEnvironment.Config.PCHOutputDirectory, "SharedPCHs"),
|
|
"Shared",
|
|
false);
|
|
}
|
|
|
|
ModulePCHEnvironment.PrecompiledHeaderFile = PCHOutput.PrecompiledHeaderFile;
|
|
|
|
ModulePCHEnvironment.OutputObjectFiles.Clear();
|
|
ModulePCHEnvironment.OutputObjectFiles.AddRange(PCHOutput.ObjectFiles);
|
|
}
|
|
else if (CPPFilesToBuild.Count < MinFilesUsingPrecompiledHeader)
|
|
{
|
|
Log.TraceVerbose("Module " + Name + " doesn't use a Shared PCH, and only has " + CPPFilesToBuild.Count.ToString() + " unity source file(s). No Unique PCH will be generated.");
|
|
}
|
|
}
|
|
|
|
if (ModulePCHEnvironment.PrecompiledHeaderFile != null)
|
|
{
|
|
// Link in the object files produced by creating the precompiled header.
|
|
LinkInputFiles.AddRange(ModulePCHEnvironment.OutputObjectFiles);
|
|
|
|
// if pch action was generated for the environment then use pch
|
|
ModulePCHCompileEnvironment.PrecompiledHeaderFile = ModulePCHEnvironment.PrecompiledHeaderFile;
|
|
|
|
// Use this compile environment from now on
|
|
CPPCompileEnvironment = ModulePCHCompileEnvironment;
|
|
}
|
|
|
|
if (bModuleUsesUnityBuild)
|
|
{
|
|
LinkInputFiles.AddRange(CompileUnityFilesWithToolChain(ToolChain, Target, CPPCompileEnvironment, CPPFilesToBuild, Name).ObjectFiles);
|
|
}
|
|
else
|
|
{
|
|
LinkInputFiles.AddRange(ToolChain.CompileCPPFiles(Target, CPPCompileEnvironment, CPPFilesToBuild, Name).ObjectFiles);
|
|
}
|
|
bWasModuleCodeCompiled = true;
|
|
}
|
|
|
|
if (BuildConfiguration.bPrintPerformanceInfo)
|
|
{
|
|
double PCHGenTime = (DateTime.UtcNow - PCHGenTimerStart).TotalSeconds;
|
|
TotalPCHGenTime += PCHGenTime;
|
|
}
|
|
}
|
|
|
|
if (!bWasModuleCodeCompiled && SourceFilesToBuild.CPPFiles.Count > 0)
|
|
{
|
|
List<FileItem> CPPFilesToCompile = SourceFilesToBuild.CPPFiles;
|
|
if (bModuleUsesUnityBuild)
|
|
{
|
|
CPPFilesToCompile = Unity.GenerateUnityCPPs(ToolChain, Target, CPPFilesToCompile, CPPCompileEnvironment, Name);
|
|
LinkInputFiles.AddRange(CompileUnityFilesWithToolChain(ToolChain, Target, CPPCompileEnvironment, CPPFilesToCompile, Name).ObjectFiles);
|
|
}
|
|
else
|
|
{
|
|
LinkInputFiles.AddRange(ToolChain.CompileCPPFiles(Target, CPPCompileEnvironment, CPPFilesToCompile, Name).ObjectFiles);
|
|
}
|
|
|
|
}
|
|
|
|
if (AutoGenerateCppInfo != null && AutoGenerateCppInfo.BuildInfo != null && !CPPCompileEnvironment.bHackHeaderGenerator)
|
|
{
|
|
string[] GeneratedFiles = Directory.GetFiles(Path.GetDirectoryName(AutoGenerateCppInfo.BuildInfo.FileWildcard), Path.GetFileName(AutoGenerateCppInfo.BuildInfo.FileWildcard));
|
|
foreach (string GeneratedFilename in GeneratedFiles)
|
|
{
|
|
FileItem GeneratedCppFileItem = FileItem.GetItemByPath(GeneratedFilename);
|
|
|
|
CachePCHUsageForModuleSourceFile(Target, CPPCompileEnvironment, GeneratedCppFileItem);
|
|
|
|
// @todo ubtmake: Check for ALL other places where we might be injecting .cpp or .rc files for compiling without caching CachedCPPIncludeInfo first (anything platform specific?)
|
|
LinkInputFiles.AddRange(ToolChain.CompileCPPFiles(Target, CPPCompileEnvironment, new List<FileItem> { GeneratedCppFileItem }, Name).ObjectFiles);
|
|
}
|
|
}
|
|
|
|
// Compile C files directly.
|
|
LinkInputFiles.AddRange(ToolChain.CompileCPPFiles(Target, CPPCompileEnvironment, SourceFilesToBuild.CFiles, Name).ObjectFiles);
|
|
|
|
// Compile CC files directly.
|
|
LinkInputFiles.AddRange(ToolChain.CompileCPPFiles(Target, CPPCompileEnvironment, SourceFilesToBuild.CCFiles, Name).ObjectFiles);
|
|
|
|
// Compile MM files directly.
|
|
LinkInputFiles.AddRange(ToolChain.CompileCPPFiles(Target, CPPCompileEnvironment, SourceFilesToBuild.MMFiles, Name).ObjectFiles);
|
|
|
|
// Compile RC files.
|
|
LinkInputFiles.AddRange(ToolChain.CompileRCFiles(Target, CPPCompileEnvironment, SourceFilesToBuild.RCFiles).ObjectFiles);
|
|
|
|
return LinkInputFiles;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Compiles the provided CPP unity files. Will
|
|
/// </summary>
|
|
private CPPOutput CompileUnityFilesWithToolChain(UEToolChain ToolChain, UEBuildTarget Target, CPPEnvironment CompileEnvironment, List<FileItem> SourceFiles, string ModuleName)
|
|
{
|
|
List<FileItem> NormalFiles = new List<FileItem>();
|
|
List<FileItem> AdaptiveFiles = new List<FileItem>();
|
|
|
|
if (BuildConfiguration.bAdaptiveUnityDisablesOptimizations && !BuildConfiguration.bStressTestUnity)
|
|
{
|
|
foreach (FileItem File in SourceFiles)
|
|
{
|
|
// Basic check as to whether something in this module is/isn't a unity file...
|
|
if (File.ToString().StartsWith(Unity.ModulePrefix))
|
|
{
|
|
NormalFiles.Add(File);
|
|
}
|
|
else
|
|
{
|
|
AdaptiveFiles.Add(File);
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
NormalFiles.AddRange(SourceFiles);
|
|
}
|
|
|
|
CPPOutput OutputFiles = new CPPOutput();
|
|
|
|
if (NormalFiles.Count > 0)
|
|
{
|
|
OutputFiles = ToolChain.CompileCPPFiles(Target, CompileEnvironment, NormalFiles, Name);
|
|
}
|
|
|
|
if (AdaptiveFiles.Count > 0)
|
|
{
|
|
// Create an unoptmized compilation environment. Need to turn of PCH due to different
|
|
// compiler settings
|
|
CPPEnvironment UnoptimziedEnvironment = CompileEnvironment.DeepCopy();
|
|
UnoptimziedEnvironment.Config.OptimizeCode = ModuleRules.CodeOptimization.Never;
|
|
UnoptimziedEnvironment.Config.PrecompiledHeaderAction = PrecompiledHeaderAction.None;
|
|
|
|
// Compile the files
|
|
CPPOutput AdaptiveOutput = ToolChain.CompileCPPFiles(Target, UnoptimziedEnvironment, AdaptiveFiles, Name);
|
|
|
|
// Merge output
|
|
OutputFiles.ObjectFiles.AddRange(AdaptiveOutput.ObjectFiles);
|
|
OutputFiles.DebugDataFiles.AddRange(AdaptiveOutput.DebugDataFiles);
|
|
}
|
|
|
|
return OutputFiles;
|
|
}
|
|
|
|
private PrecompileHeaderEnvironment ApplySharedPCH(CPPEnvironment GlobalCompileEnvironment, CPPEnvironment CompileEnvironment, CPPEnvironment ModuleCompileEnvironment, List<FileItem> CPPFiles, ref FileItem SharedPCHHeaderFile)
|
|
{
|
|
// Check to see if we have a PCH header already setup that we can use
|
|
FileItem SharedPCHHeaderFileCopy = SharedPCHHeaderFile;
|
|
PrecompileHeaderEnvironment SharedPCHEnvironment = GlobalCompileEnvironment.SharedPCHEnvironments.Find(Env => Env.PrecompiledHeaderIncludeFilename == SharedPCHHeaderFileCopy);
|
|
if (SharedPCHEnvironment == null)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
// Don't mix CLR modes
|
|
if (SharedPCHEnvironment.CLRMode != ModuleCompileEnvironment.Config.CLRMode)
|
|
{
|
|
Log.TraceVerbose("Module {0} cannot use existing Shared PCH '{1}' (from module '{2}') because CLR modes don't match", Name, SharedPCHEnvironment.PrecompiledHeaderIncludeFilename.AbsolutePath, SharedPCHEnvironment.ModuleName);
|
|
SharedPCHHeaderFile = null;
|
|
return null;
|
|
}
|
|
// Don't mix RTTI modes
|
|
if (Rules.bUseRTTI)
|
|
{
|
|
Log.TraceVerbose("Module {0} cannot use existing Shared PCH '{1}' (from module '{2}') because RTTI modes don't match", Name, SharedPCHEnvironment.PrecompiledHeaderIncludeFilename.AbsolutePath, SharedPCHEnvironment.ModuleName);
|
|
SharedPCHHeaderFile = null;
|
|
return null;
|
|
}
|
|
|
|
// Don't mix non-optimized code with optimized code (PCHs won't be compatible)
|
|
ModuleRules.CodeOptimization SharedPCHCodeOptimization = SharedPCHEnvironment.OptimizeCode;
|
|
ModuleRules.CodeOptimization ModuleCodeOptimization = ModuleCompileEnvironment.Config.OptimizeCode;
|
|
|
|
if (CompileEnvironment.Config.Target.Configuration != CPPTargetConfiguration.Debug)
|
|
{
|
|
if (SharedPCHCodeOptimization == ModuleRules.CodeOptimization.InNonDebugBuilds)
|
|
{
|
|
SharedPCHCodeOptimization = ModuleRules.CodeOptimization.Always;
|
|
}
|
|
|
|
if (ModuleCodeOptimization == ModuleRules.CodeOptimization.InNonDebugBuilds)
|
|
{
|
|
ModuleCodeOptimization = ModuleRules.CodeOptimization.Always;
|
|
}
|
|
}
|
|
|
|
if (SharedPCHCodeOptimization != ModuleCodeOptimization)
|
|
{
|
|
Log.TraceVerbose("Module {0} cannot use existing Shared PCH '{1}' (from module '{2}') because optimization levels don't match", Name, SharedPCHEnvironment.PrecompiledHeaderIncludeFilename.AbsolutePath, SharedPCHEnvironment.ModuleName);
|
|
SharedPCHHeaderFile = null;
|
|
return null;
|
|
}
|
|
|
|
return SharedPCHEnvironment;
|
|
}
|
|
|
|
public static FileItem CachePCHUsageForModuleSourceFile(UEBuildTarget Target, CPPEnvironment ModuleCompileEnvironment, FileItem CPPFile)
|
|
{
|
|
if (!CPPFile.bExists)
|
|
{
|
|
throw new BuildException("Required source file not found: " + CPPFile.AbsolutePath);
|
|
}
|
|
|
|
DateTime PCHCacheTimerStart = DateTime.UtcNow;
|
|
|
|
UEBuildPlatform BuildPlatform = UEBuildPlatform.GetBuildPlatformForCPPTargetPlatform(ModuleCompileEnvironment.Config.Target.Platform);
|
|
List<string> IncludePathsToSearch = ModuleCompileEnvironment.Config.CPPIncludeInfo.GetIncludesPathsToSearch(CPPFile);
|
|
|
|
// Store the module compile environment along with the .cpp file. This is so that we can use it later on when looking
|
|
// for header dependencies
|
|
CPPFile.CachedCPPIncludeInfo = ModuleCompileEnvironment.Config.CPPIncludeInfo;
|
|
|
|
FileItem PCHFile = CachePCHUsageForCPPFile(Target, CPPFile, BuildPlatform, IncludePathsToSearch, ModuleCompileEnvironment.Config.CPPIncludeInfo.IncludeFileSearchDictionary);
|
|
|
|
if (BuildConfiguration.bPrintPerformanceInfo)
|
|
{
|
|
double PCHCacheTime = (DateTime.UtcNow - PCHCacheTimerStart).TotalSeconds;
|
|
TotalPCHCacheTime += PCHCacheTime;
|
|
}
|
|
|
|
return PCHFile;
|
|
}
|
|
|
|
|
|
public void CachePCHUsageForModuleSourceFiles(UEBuildTarget Target, CPPEnvironment ModuleCompileEnvironment)
|
|
{
|
|
if (ProcessedDependencies == null)
|
|
{
|
|
DateTime PCHCacheTimerStart = DateTime.UtcNow;
|
|
|
|
UEBuildPlatform BuildPlatform = UEBuildPlatform.GetBuildPlatformForCPPTargetPlatform(ModuleCompileEnvironment.Config.Target.Platform);
|
|
|
|
bool bFoundAProblemWithPCHs = false;
|
|
|
|
FileItem UniquePCH = null;
|
|
foreach (FileItem CPPFile in SourceFilesFound.CPPFiles) // @todo ubtmake: We're not caching CPPEnvironments for .c/.mm files, etc. Even though they don't use PCHs, they still have #includes! This can break dependency checking!
|
|
{
|
|
// Build a single list of include paths to search.
|
|
List<string> IncludePathsToSearch = ModuleCompileEnvironment.Config.CPPIncludeInfo.GetIncludesPathsToSearch(CPPFile);
|
|
|
|
// Store the module compile environment along with the .cpp file. This is so that we can use it later on when looking
|
|
// for header dependencies
|
|
CPPFile.CachedCPPIncludeInfo = ModuleCompileEnvironment.Config.CPPIncludeInfo;
|
|
|
|
// Find headers used by the source file.
|
|
FileItem PCH = UEBuildModuleCPP.CachePCHUsageForCPPFile(Target, CPPFile, BuildPlatform, IncludePathsToSearch, ModuleCompileEnvironment.Config.CPPIncludeInfo.IncludeFileSearchDictionary);
|
|
if (PCH == null)
|
|
{
|
|
throw new BuildException("Source file \"{0}\" is not including any headers. We expect all modules to include a header file for precompiled header generation. Please add an #include statement.", CPPFile.AbsolutePath);
|
|
}
|
|
|
|
if (UniquePCH == null)
|
|
{
|
|
UniquePCH = PCH;
|
|
}
|
|
else if (!UniquePCH.Info.Name.Equals(PCH.Info.Name, StringComparison.InvariantCultureIgnoreCase)) // @todo ubtmake: We do a string compare on the file name (not path) here, because sometimes the include resolver will pick an Intermediate copy of a PCH header file and throw off our comparisons
|
|
{
|
|
// OK, looks like we have multiple source files including a different header file first. We'll keep track of this and print out
|
|
// helpful information afterwards.
|
|
bFoundAProblemWithPCHs = true;
|
|
}
|
|
}
|
|
|
|
ProcessedDependencies = new ProcessedDependenciesClass { UniquePCHHeaderFile = UniquePCH };
|
|
|
|
|
|
if (bFoundAProblemWithPCHs)
|
|
{
|
|
// Map from pch header string to the source files that use that PCH
|
|
Dictionary<FileReference, List<FileItem>> UsageMapPCH = new Dictionary<FileReference, List<FileItem>>();
|
|
foreach (FileItem CPPFile in SourceFilesToBuild.CPPFiles)
|
|
{
|
|
// Create a new entry if not in the pch usage map
|
|
UsageMapPCH.GetOrAddNew(CPPFile.PrecompiledHeaderIncludeFilename).Add(CPPFile);
|
|
}
|
|
|
|
if (BuildConfiguration.bPrintDebugInfo)
|
|
{
|
|
Log.TraceVerbose("{0} PCH files for module {1}:", UsageMapPCH.Count, Name);
|
|
int MostFilesIncluded = 0;
|
|
foreach (KeyValuePair<FileReference, List<FileItem>> CurPCH in UsageMapPCH)
|
|
{
|
|
if (CurPCH.Value.Count > MostFilesIncluded)
|
|
{
|
|
MostFilesIncluded = CurPCH.Value.Count;
|
|
}
|
|
|
|
Log.TraceVerbose(" {0} ({1} files including it: {2}, ...)", CurPCH.Key, CurPCH.Value.Count, CurPCH.Value[0].AbsolutePath);
|
|
}
|
|
}
|
|
|
|
if (UsageMapPCH.Count > 1)
|
|
{
|
|
// Keep track of the PCH file that is most used within this module
|
|
FileReference MostFilesAreIncludingPCH = null;
|
|
int MostFilesIncluded = 0;
|
|
foreach (KeyValuePair<FileReference, List<FileItem>> CurPCH in UsageMapPCH.Where(PCH => PCH.Value.Count > MostFilesIncluded))
|
|
{
|
|
MostFilesAreIncludingPCH = CurPCH.Key;
|
|
MostFilesIncluded = CurPCH.Value.Count;
|
|
}
|
|
|
|
// Find all of the files that are not including our "best" PCH header
|
|
StringBuilder FilesNotIncludingBestPCH = new StringBuilder();
|
|
foreach (KeyValuePair<FileReference, List<FileItem>> CurPCH in UsageMapPCH.Where(PCH => PCH.Key != MostFilesAreIncludingPCH))
|
|
{
|
|
foreach (FileItem SourceFile in CurPCH.Value)
|
|
{
|
|
FilesNotIncludingBestPCH.AppendFormat("{0} (including {1})\n", SourceFile.AbsolutePath, CurPCH.Key);
|
|
}
|
|
}
|
|
|
|
// Bail out and let the user know which source files may need to be fixed up
|
|
throw new BuildException(
|
|
"All source files in module \"{0}\" must include the same precompiled header first. Currently \"{1}\" is included by most of the source files. The following source files are not including \"{1}\" as their first include:\n\n{2}",
|
|
Name,
|
|
MostFilesAreIncludingPCH,
|
|
FilesNotIncludingBestPCH);
|
|
}
|
|
}
|
|
|
|
if (BuildConfiguration.bPrintPerformanceInfo)
|
|
{
|
|
double PCHCacheTime = (DateTime.UtcNow - PCHCacheTimerStart).TotalSeconds;
|
|
TotalPCHCacheTime += PCHCacheTime;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private static FileItem CachePCHUsageForCPPFile(UEBuildTarget Target, FileItem CPPFile, UEBuildPlatform BuildPlatform, List<string> IncludePathsToSearch, Dictionary<string, FileItem> IncludeFileSearchDictionary)
|
|
{
|
|
// @todo ubtmake: We don't really need to scan every file looking for PCH headers, just need one. The rest is just for error checking.
|
|
// @todo ubtmake: We don't need all of the direct includes either. We just need the first, unless we want to check for errors.
|
|
List<DependencyInclude> DirectIncludeFilenames = CPPEnvironment.GetDirectIncludeDependencies(Target, CPPFile, BuildPlatform, bOnlyCachedDependencies: false);
|
|
if (BuildConfiguration.bPrintDebugInfo)
|
|
{
|
|
Log.TraceVerbose("Found direct includes for {0}: {1}", Path.GetFileName(CPPFile.AbsolutePath), string.Join(", ", DirectIncludeFilenames.Select(F => F.IncludeName)));
|
|
}
|
|
|
|
if (DirectIncludeFilenames.Count == 0)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
DependencyInclude FirstInclude = DirectIncludeFilenames[0];
|
|
|
|
// The pch header should always be the first include in the source file.
|
|
// NOTE: This is not an absolute path. This is just the literal include string from the source file!
|
|
CPPFile.PCHHeaderNameInCode = FirstInclude.IncludeName;
|
|
|
|
// Resolve the PCH header to an absolute path.
|
|
// Check NullOrEmpty here because if the file could not be resolved we need to throw an exception
|
|
if (FirstInclude.IncludeResolvedNameIfSuccessful != null &&
|
|
// ignore any preexisting resolve cache if we are not configured to use it.
|
|
BuildConfiguration.bUseIncludeDependencyResolveCache &&
|
|
// if we are testing the resolve cache, we force UBT to resolve every time to look for conflicts
|
|
!BuildConfiguration.bTestIncludeDependencyResolveCache)
|
|
{
|
|
CPPFile.PrecompiledHeaderIncludeFilename = FirstInclude.IncludeResolvedNameIfSuccessful;
|
|
return FileItem.GetItemByFileReference(CPPFile.PrecompiledHeaderIncludeFilename);
|
|
}
|
|
|
|
// search the include paths to resolve the file.
|
|
FileItem PrecompiledHeaderIncludeFile = CPPEnvironment.FindIncludedFile(CPPFile.PCHHeaderNameInCode, !BuildConfiguration.bCheckExternalHeadersForModification, IncludePathsToSearch, IncludeFileSearchDictionary);
|
|
if (PrecompiledHeaderIncludeFile == null)
|
|
{
|
|
throw new BuildException("The first include statement in source file '{0}' is trying to include the file '{1}' as the precompiled header, but that file could not be located in any of the module's include search paths.", CPPFile.AbsolutePath, CPPFile.PCHHeaderNameInCode);
|
|
}
|
|
|
|
CPPEnvironment.IncludeDependencyCache[Target].CacheResolvedIncludeFullPath(CPPFile, 0, PrecompiledHeaderIncludeFile.Reference);
|
|
CPPFile.PrecompiledHeaderIncludeFilename = PrecompiledHeaderIncludeFile.Reference;
|
|
|
|
return PrecompiledHeaderIncludeFile;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Creates a compile environment from a base environment based on the module settings.
|
|
/// </summary>
|
|
/// <param name="BaseCompileEnvironment">An existing environment to base the module compile environment on.</param>
|
|
/// <returns>The new module compile environment.</returns>
|
|
public CPPEnvironment CreateModuleCompileEnvironment(UEBuildTarget Target, CPPEnvironment BaseCompileEnvironment)
|
|
{
|
|
CPPEnvironment Result = BaseCompileEnvironment.DeepCopy();
|
|
|
|
if (Binary == null)
|
|
{
|
|
// Adding this check here as otherwise the call to Binary.Config.IntermediateDirectory will give an
|
|
// unhandled exception
|
|
throw new BuildException("UEBuildBinary not set up for module {0}", this.ToString());
|
|
}
|
|
|
|
// Override compile environment
|
|
Result.Config.bFasterWithoutUnity = Rules.bFasterWithoutUnity;
|
|
Result.Config.OptimizeCode = Rules.OptimizeCode;
|
|
Result.Config.bUseRTTI = Rules.bUseRTTI;
|
|
Result.Config.bUseAVX = Rules.bUseAVX;
|
|
Result.Config.bEnableBufferSecurityChecks = Rules.bEnableBufferSecurityChecks;
|
|
Result.Config.MinSourceFilesForUnityBuildOverride = Rules.MinSourceFilesForUnityBuildOverride;
|
|
Result.Config.MinFilesUsingPrecompiledHeaderOverride = Rules.MinFilesUsingPrecompiledHeaderOverride;
|
|
Result.Config.bBuildLocallyWithSNDBS = Rules.bBuildLocallyWithSNDBS;
|
|
Result.Config.bEnableExceptions = Rules.bEnableExceptions;
|
|
Result.Config.bEnableShadowVariableWarning = Rules.bEnableShadowVariableWarnings;
|
|
Result.Config.bUseStaticCRT = (Target.Rules != null && Target.Rules.bUseStaticCRT);
|
|
Result.Config.OutputDirectory = DirectoryReference.Combine(Binary.Config.IntermediateDirectory, Name);
|
|
|
|
// Switch the optimization flag if we're building a game module. Also pass the definition for building in DebugGame along (see ModuleManager.h for notes).
|
|
if (Target.Configuration == UnrealTargetConfiguration.DebugGame)
|
|
{
|
|
if (!ModuleDirectory.IsUnderDirectory(UnrealBuildTool.EngineDirectory))
|
|
{
|
|
Result.Config.Target.Configuration = CPPTargetConfiguration.Debug;
|
|
Result.Config.Definitions.Add("UE_BUILD_DEVELOPMENT_WITH_DEBUGGAME=1");
|
|
}
|
|
}
|
|
|
|
// Add the module's private definitions.
|
|
Result.Config.Definitions.AddRange(Definitions);
|
|
|
|
// Setup the compile environment for the module.
|
|
SetupPrivateCompileEnvironment(Result.Config.CPPIncludeInfo.IncludePaths, Result.Config.CPPIncludeInfo.SystemIncludePaths, Result.Config.Definitions, Result.Config.AdditionalFrameworks);
|
|
|
|
// @hack to skip adding definitions to compile environment, they will be baked into source code files
|
|
if (bSkipDefinitionsForCompileEnvironment)
|
|
{
|
|
Result.Config.Definitions.Clear();
|
|
Result.Config.CPPIncludeInfo.IncludePaths = new HashSet<string>(BaseCompileEnvironment.Config.CPPIncludeInfo.IncludePaths);
|
|
}
|
|
|
|
return Result;
|
|
}
|
|
|
|
public class UHTModuleInfoCacheType
|
|
{
|
|
public UHTModuleInfoCacheType(IEnumerable<string> InHeaderFilenames, UHTModuleInfo InInfo)
|
|
{
|
|
HeaderFilenames = InHeaderFilenames;
|
|
Info = InInfo;
|
|
}
|
|
|
|
public IEnumerable<string> HeaderFilenames = null;
|
|
public UHTModuleInfo Info = null;
|
|
}
|
|
|
|
private UHTModuleInfoCacheType UHTModuleInfoCache = null;
|
|
|
|
/// Total time spent generating PCHs for modules (not actually compiling, but generating the PCH's input data)
|
|
public static double TotalPCHGenTime = 0.0;
|
|
|
|
/// Time spent caching which PCH header is included by each module and source file
|
|
public static double TotalPCHCacheTime = 0.0;
|
|
|
|
|
|
/// <summary>
|
|
/// If any of this module's source files contain UObject definitions, this will return those header files back to the caller
|
|
/// </summary>
|
|
/// <returns>
|
|
public UHTModuleInfoCacheType GetCachedUHTModuleInfo(EGeneratedCodeVersion GeneratedCodeVersion)
|
|
{
|
|
if (UHTModuleInfoCache == null)
|
|
{
|
|
IEnumerable<string> HeaderFilenames = Directory.GetFiles(ModuleDirectory.FullName, "*.h", SearchOption.AllDirectories);
|
|
UHTModuleInfo Info = ExternalExecution.CreateUHTModuleInfo(HeaderFilenames, Name, ModuleDirectory, Type, GeneratedCodeVersion);
|
|
UHTModuleInfoCache = new UHTModuleInfoCacheType(Info.PublicUObjectHeaders.Concat(Info.PublicUObjectClassesHeaders).Concat(Info.PrivateUObjectHeaders).Select(x => x.AbsolutePath).ToList(), Info);
|
|
}
|
|
|
|
return UHTModuleInfoCache;
|
|
}
|
|
|
|
public override void GetAllDependencyModules(List<UEBuildModule> ReferencedModules, HashSet<UEBuildModule> IgnoreReferencedModules, bool bIncludeDynamicallyLoaded, bool bForceCircular, bool bOnlyDirectDependencies)
|
|
{
|
|
List<UEBuildModule> AllDependencyModules = new List<UEBuildModule>();
|
|
AllDependencyModules.AddRange(PrivateDependencyModules);
|
|
AllDependencyModules.AddRange(PublicDependencyModules);
|
|
if (bIncludeDynamicallyLoaded)
|
|
{
|
|
AllDependencyModules.AddRange(DynamicallyLoadedModules);
|
|
AllDependencyModules.AddRange(PlatformSpecificDynamicallyLoadedModules);
|
|
}
|
|
|
|
foreach (UEBuildModule DependencyModule in AllDependencyModules)
|
|
{
|
|
if (!IgnoreReferencedModules.Contains(DependencyModule))
|
|
{
|
|
// Don't follow circular back-references!
|
|
bool bIsCircular = HasCircularDependencyOn(DependencyModule.Name);
|
|
if (bForceCircular || !bIsCircular)
|
|
{
|
|
IgnoreReferencedModules.Add(DependencyModule);
|
|
|
|
if (!bOnlyDirectDependencies)
|
|
{
|
|
// Recurse into dependent modules first
|
|
DependencyModule.GetAllDependencyModules(ReferencedModules, IgnoreReferencedModules, bIncludeDynamicallyLoaded, bForceCircular, bOnlyDirectDependencies);
|
|
}
|
|
|
|
ReferencedModules.Add(DependencyModule);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public override void RecursivelyAddPrecompiledModules(List<UEBuildModule> Modules)
|
|
{
|
|
if (!Modules.Contains(this))
|
|
{
|
|
Modules.Add(this);
|
|
|
|
// Get the dependent modules
|
|
List<UEBuildModule> DependentModules = new List<UEBuildModule>();
|
|
if (PrivateDependencyModules != null)
|
|
{
|
|
DependentModules.AddRange(PrivateDependencyModules);
|
|
}
|
|
if (PublicDependencyModules != null)
|
|
{
|
|
DependentModules.AddRange(PublicDependencyModules);
|
|
}
|
|
if (DynamicallyLoadedModules != null)
|
|
{
|
|
DependentModules.AddRange(DynamicallyLoadedModules);
|
|
}
|
|
if (PlatformSpecificDynamicallyLoadedModules != null)
|
|
{
|
|
DependentModules.AddRange(PlatformSpecificDynamicallyLoadedModules);
|
|
}
|
|
|
|
// Find modules for each of them, and add their dependencies too
|
|
foreach (UEBuildModule DependentModule in DependentModules)
|
|
{
|
|
DependentModule.RecursivelyAddPrecompiledModules(Modules);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// A module that is compiled from C++ CLR code.
|
|
/// </summary>
|
|
class UEBuildModuleCPPCLR : UEBuildModuleCPP
|
|
{
|
|
/// <summary>
|
|
/// The assemblies referenced by the module's private implementation.
|
|
/// </summary>
|
|
HashSet<string> PrivateAssemblyReferences;
|
|
|
|
public UEBuildModuleCPPCLR(
|
|
string InName,
|
|
UHTModuleType InType,
|
|
DirectoryReference InModuleDirectory,
|
|
DirectoryReference InGeneratedCodeDirectory,
|
|
IntelliSenseGatherer InIntelliSenseGatherer,
|
|
IEnumerable<FileItem> InSourceFiles,
|
|
ModuleRules InRules,
|
|
bool bInBuildSourceFiles,
|
|
FileReference InRulesFile
|
|
)
|
|
: base(InName, InType, InModuleDirectory, InGeneratedCodeDirectory, InIntelliSenseGatherer,
|
|
InSourceFiles, InRules,
|
|
bInBuildSourceFiles, InRulesFile)
|
|
{
|
|
PrivateAssemblyReferences = HashSetFromOptionalEnumerableStringParameter(InRules.PrivateAssemblyReferences);
|
|
}
|
|
|
|
// UEBuildModule interface.
|
|
public override List<FileItem> Compile(UEBuildTarget Target, UEToolChain ToolChain, CPPEnvironment GlobalCompileEnvironment, CPPEnvironment CompileEnvironment)
|
|
{
|
|
CPPEnvironment ModuleCLREnvironment = CompileEnvironment.DeepCopy();
|
|
|
|
// Setup the module environment for the project CLR mode
|
|
ModuleCLREnvironment.Config.CLRMode = CPPCLRMode.CLREnabled;
|
|
|
|
// Add the private assembly references to the compile environment.
|
|
foreach (string PrivateAssemblyReference in PrivateAssemblyReferences)
|
|
{
|
|
ModuleCLREnvironment.AddPrivateAssembly(PrivateAssemblyReference);
|
|
}
|
|
|
|
// Pass the CLR compilation environment to the standard C++ module compilation code.
|
|
return base.Compile(Target, ToolChain, GlobalCompileEnvironment, ModuleCLREnvironment);
|
|
}
|
|
|
|
public override void SetupPrivateLinkEnvironment(
|
|
UEBuildBinary SourceBinary,
|
|
LinkEnvironment LinkEnvironment,
|
|
List<UEBuildBinary> BinaryDependencies,
|
|
HashSet<UEBuildModule> VisitedModules
|
|
)
|
|
{
|
|
base.SetupPrivateLinkEnvironment(SourceBinary, LinkEnvironment, BinaryDependencies, VisitedModules);
|
|
|
|
// Setup the link environment for linking a CLR binary.
|
|
LinkEnvironment.Config.CLRMode = CPPCLRMode.CLREnabled;
|
|
}
|
|
}
|
|
|
|
public class UEBuildFramework
|
|
{
|
|
public UEBuildFramework(string InFrameworkName)
|
|
{
|
|
FrameworkName = InFrameworkName;
|
|
}
|
|
|
|
public UEBuildFramework(string InFrameworkName, string InFrameworkZipPath)
|
|
{
|
|
FrameworkName = InFrameworkName;
|
|
FrameworkZipPath = InFrameworkZipPath;
|
|
}
|
|
|
|
public UEBuildFramework(string InFrameworkName, string InFrameworkZipPath, string InCopyBundledAssets)
|
|
{
|
|
FrameworkName = InFrameworkName;
|
|
FrameworkZipPath = InFrameworkZipPath;
|
|
CopyBundledAssets = InCopyBundledAssets;
|
|
}
|
|
|
|
public UEBuildModule OwningModule = null;
|
|
public string FrameworkName = null;
|
|
public string FrameworkZipPath = null;
|
|
public string CopyBundledAssets = null;
|
|
}
|
|
|
|
public class UEBuildBundleResource
|
|
{
|
|
public UEBuildBundleResource(string InResourcePath, string InBundleContentsSubdir = "Resources", bool bInShouldLog = true)
|
|
{
|
|
ResourcePath = InResourcePath;
|
|
BundleContentsSubdir = InBundleContentsSubdir;
|
|
bShouldLog = bInShouldLog;
|
|
}
|
|
|
|
public string ResourcePath = null;
|
|
public string BundleContentsSubdir = null;
|
|
public bool bShouldLog = true;
|
|
}
|
|
|
|
public class PrecompileHeaderEnvironment
|
|
{
|
|
/// <summary>
|
|
/// The name of the module this PCH header is a member of
|
|
/// </summary>
|
|
public readonly string ModuleName;
|
|
|
|
/// <summary>
|
|
/// PCH header file name as it appears in an #include statement in source code (might include partial, or no relative path.)
|
|
/// This is needed by some compilers to use PCH features.
|
|
/// </summary>
|
|
public string PCHHeaderNameInCode;
|
|
|
|
/// <summary>
|
|
/// The source header file that this precompiled header will be generated for
|
|
/// </summary>
|
|
public readonly FileItem PrecompiledHeaderIncludeFilename;
|
|
|
|
/// <summary>
|
|
/// Whether this precompiled header will be built with CLR features enabled. We won't mix and match CLR PCHs with non-CLR PCHs
|
|
/// </summary>
|
|
public readonly CPPCLRMode CLRMode;
|
|
|
|
/// <summary>
|
|
/// Whether this precompiled header will be built with code optimization enabled.
|
|
/// </summary>
|
|
public readonly ModuleRules.CodeOptimization OptimizeCode;
|
|
|
|
/// <summary>
|
|
/// The PCH file we're generating
|
|
/// </summary>
|
|
public FileItem PrecompiledHeaderFile = null;
|
|
|
|
/// <summary>
|
|
/// Object files emitted from the compiler when generating this precompiled header. These will be linked into modules that
|
|
/// include this PCH
|
|
/// </summary>
|
|
public readonly List<FileItem> OutputObjectFiles = new List<FileItem>();
|
|
|
|
public PrecompileHeaderEnvironment(string InitModuleName, string InitPCHHeaderNameInCode, FileItem InitPrecompiledHeaderIncludeFilename, CPPCLRMode InitCLRMode, ModuleRules.CodeOptimization InitOptimizeCode)
|
|
{
|
|
ModuleName = InitModuleName;
|
|
PCHHeaderNameInCode = InitPCHHeaderNameInCode;
|
|
PrecompiledHeaderIncludeFilename = InitPrecompiledHeaderIncludeFilename;
|
|
CLRMode = InitCLRMode;
|
|
OptimizeCode = InitOptimizeCode;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Creates a precompiled header action to generate a new pch file
|
|
/// </summary>
|
|
/// <param name="PCHHeaderNameInCode">The precompiled header name as it appeared in an #include statement</param>
|
|
/// <param name="PrecompiledHeaderIncludeFilename">Name of the header used for pch.</param>
|
|
/// <param name="ProjectCPPEnvironment">The environment the C/C++ files in the project are compiled with.</param>
|
|
/// <param name="OutputDirectory">The folder to save the generated PCH file to</param>
|
|
/// <param name="ModuleName">Name of the module this PCH is being generated for</param>
|
|
/// <param name="bAllowDLLExports">True if we should allow DLLEXPORT definitions for this PCH</param>
|
|
/// <returns>the compilation output result of the created pch.</returns>
|
|
public static CPPOutput GeneratePCHCreationAction(UEToolChain ToolChain, UEBuildTarget Target, string PCHHeaderNameInCode, FileItem PrecompiledHeaderIncludeFilename, CPPEnvironment ProjectCPPEnvironment, DirectoryReference OutputDirectory, DirectoryReference PCHOutputDirectory, string ModuleName, bool bAllowDLLExports)
|
|
{
|
|
// Find the header file to be precompiled. Don't skip external headers
|
|
if (PrecompiledHeaderIncludeFilename.bExists)
|
|
{
|
|
// Create a Dummy wrapper around the PCH to avoid problems with #pragma once on clang
|
|
string PCHGuardDefine = Path.GetFileNameWithoutExtension(PrecompiledHeaderIncludeFilename.AbsolutePath).ToUpperInvariant();
|
|
string LocalPCHHeaderNameInCode = ToolChain.ConvertPath(PrecompiledHeaderIncludeFilename.AbsolutePath);
|
|
string TmpPCHHeaderContents = String.Format("#ifndef __AUTO_{0}_H__\n#define __AUTO_{0}_H__\n//Last Write: {2}\n#include \"{1}\"\n#endif//__AUTO_{0}_H__", PCHGuardDefine, LocalPCHHeaderNameInCode, PrecompiledHeaderIncludeFilename.LastWriteTime);
|
|
FileReference DummyPath = FileReference.Combine(
|
|
ProjectCPPEnvironment.Config.OutputDirectory,
|
|
Path.GetFileName(PrecompiledHeaderIncludeFilename.AbsolutePath));
|
|
FileItem DummyPCH = FileItem.CreateIntermediateTextFile(DummyPath, TmpPCHHeaderContents);
|
|
|
|
// Create a new C++ environment that is used to create the PCH.
|
|
CPPEnvironment ProjectPCHEnvironment = ProjectCPPEnvironment.DeepCopy();
|
|
ProjectPCHEnvironment.Config.PrecompiledHeaderAction = PrecompiledHeaderAction.Create;
|
|
ProjectPCHEnvironment.Config.PrecompiledHeaderIncludeFilename = PrecompiledHeaderIncludeFilename.Reference;
|
|
ProjectPCHEnvironment.Config.PCHHeaderNameInCode = PCHHeaderNameInCode;
|
|
ProjectPCHEnvironment.Config.OutputDirectory = OutputDirectory;
|
|
ProjectPCHEnvironment.Config.PCHOutputDirectory = PCHOutputDirectory;
|
|
|
|
if (!bAllowDLLExports)
|
|
{
|
|
for (int CurDefinitionIndex = 0; CurDefinitionIndex < ProjectPCHEnvironment.Config.Definitions.Count; ++CurDefinitionIndex)
|
|
{
|
|
// We change DLLEXPORT to DLLIMPORT for "shared" PCH headers
|
|
string OldDefinition = ProjectPCHEnvironment.Config.Definitions[CurDefinitionIndex];
|
|
if (OldDefinition.EndsWith("=DLLEXPORT"))
|
|
{
|
|
ProjectPCHEnvironment.Config.Definitions[CurDefinitionIndex] = OldDefinition.Replace("DLLEXPORT", "DLLIMPORT");
|
|
}
|
|
}
|
|
}
|
|
|
|
// Cache our CPP environment so that we can check for outdatedness quickly. Only files that have includes need this.
|
|
DummyPCH.CachedCPPIncludeInfo = ProjectPCHEnvironment.Config.CPPIncludeInfo;
|
|
|
|
Log.TraceVerbose("Found PCH file \"{0}\".", PrecompiledHeaderIncludeFilename);
|
|
|
|
// Create the action to compile the PCH file.
|
|
return ToolChain.CompileCPPFiles(Target, ProjectPCHEnvironment, new List<FileItem>() { DummyPCH }, ModuleName);
|
|
}
|
|
throw new BuildException("Couldn't find PCH file \"{0}\".", PrecompiledHeaderIncludeFilename);
|
|
}
|
|
}
|
|
}
|