Commit Graph

157 Commits

Author SHA1 Message Date
Marc Audy
a7f9391231 Merge UE5/Release-Engine-Staging @ 14811410 to UE5/Main
This represents UE4/Main @ 14768117

For ReleaseObjectVersion.h
#lockdown Marcus.Wassmer

[CL 14811440 by Marc Audy in ue5-main branch]
2020-11-24 18:42:39 -04:00
halfdan ingvarsson
b1d3d7ab1c Add support for enabling the clang static analyzer on Windows when using the clang compiler.
The clang static analyser is arguably a lot more powerful tool than either PVS or the MSVC, and gives detailed information how how it arrived at its conclusion, unlike the other two (example listed below).

Changed the WindowsStaticAnalyzer.VisualCpp enum to alias to a new entry, WindowsStaticAnalyzer.Default, which picks the default static analysis tool for the given working compiler.

Presently, only a subset of checkers is enabled. As of this CL, the analyzer reports a huge amount of issues, some of which are benign (such as knowingly de-referencing shared pointers when we're sure they're valid, although those could benefit from being changed to shared refs) and some real bugs, for example calls to virtual functions from constructors/destructors, memory leaks in Slate and what looks like a really tricky, potential free-after-use issue with TSharedRef.  Until some of those issues are resolved, I wouldn't recommend enabling this as a analysis pass in lieu of MSVC or PVS. It can be run selectively on individual files for now, however.

Example output:
  E:\dev\ue5_main1\Engine\Source\Developer\StandaloneRenderer\Private\Windows\D3D\SlateD3DIndexBuffer.cpp(85,4): warning: Potential leak of memory pointed to by 'SavedIndices' [cplusplus.NewDeleteLeaks]
                          LogSlateD3DRendererFailure(TEXT("FSlateD3DIndexBuffer::ResizeBuffer() - ID3D11Device::CreateBuffer"), Hr);
                          ^
  E:\dev\ue5_main1\Engine\Source\Developer\StandaloneRenderer\Private\Windows\D3D\SlateD3DIndexBuffer.cpp(45,6): note: Assuming 'NumIndices' is > field 'MaxNumIndices'
          if( NumIndices > MaxNumIndices )
              ^~~~~~~~~~~~~~~~~~~~~~~~~~
  E:\dev\ue5_main1\Engine\Source\Developer\StandaloneRenderer\Private\Windows\D3D\SlateD3DIndexBuffer.cpp(45,2): note: Taking true branch
          if( NumIndices > MaxNumIndices )
          ^
  E:\dev\ue5_main1\Engine\Source\Developer\StandaloneRenderer\Private\Windows\D3D\SlateD3DIndexBuffer.cpp(53,19): note: Memory is allocated
                          SavedIndices = new uint8[MaxNumIndices*sizeof(SlateIndex)];
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  E:\dev\ue5_main1\Engine\Source\Developer\StandaloneRenderer\Private\Windows\D3D\SlateD3DIndexBuffer.cpp(68,7): note: Assuming 'Hr' is < 0
                  if (SUCCEEDED(Hr))
                      ^~~~~~~~~~~~~
  C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\winerror.h(28788,24): note: expanded from macro 'SUCCEEDED'
  #define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0)
                         ^~~~~~~~~~~~~~~~~~~~
  E:\dev\ue5_main1\Engine\Source\Developer\StandaloneRenderer\Private\Windows\D3D\SlateD3DIndexBuffer.cpp(68,3): note: Taking false branch
                  if (SUCCEEDED(Hr))
                  ^
  E:\dev\ue5_main1\Engine\Source\Developer\StandaloneRenderer\Private\Windows\D3D\SlateD3DIndexBuffer.cpp(85,4): note: Potential leak of memory pointed to by 'SavedIndices'
                          LogSlateD3DRendererFailure(TEXT("FSlateD3DIndexBuffer::ResizeBuffer() - ID3D11Device::CreateBuffer"), Hr);
                          ^

#rb Ben.Marsh
#jira none
#rnx

[CL 14765788 by halfdan ingvarsson in ue5-main branch]
2020-11-17 16:28:25 -04:00
Ben Marsh
7932350c0a Do not fall back to choosing VS2017 toolchain if a specific 2019 version is not found.
#rb none

[CL 14474210 by Ben Marsh in ue5-main branch]
2020-10-12 15:28:41 -04:00
Marc Audy
50a3d7d368 Merge Release-Engine-Staging to Main @ CL# 14467590
This represents UE4/Main @ 14432125 + some cherrypick fixes

[CL 14468207 by Marc Audy in ue5-main branch]
2020-10-09 22:42:26 -04:00
geoff evans
bcb5d9ed4e Add exception handler for building without visual studio installed on windows (clang).
#jira UE-99919
#rb trivial

[CL 14357669 by geoff evans in ue5-main branch]
2020-09-21 14:01:00 -04:00
Ben Marsh
57d9b51398 Initial support for C++20 modules.
Requires Visual Studio 2019 15.8 Preview 3, and targets to specify bEnableCppModules = true. Unsupported on other compilers.

Notes:
- Module interfaces need to be placed in .IXX files.
- Module/module dependencies are determined by a post-makefile/pre-build scan of all module interfaces using the compiler, and cause additional prerequisites to be inserted into the dependency graph before execution.
- Available module IFC search paths use normal UE module dependency rules.
- Header units are not currently supported.
- Regular C++ files cannot currently implement functions defined in module interfaces, due to the macros force included by UBT. These macros need to be placed in the global module fragment, but declaring a global module fragment must be done from the translation unit being compiled (making force-included headers invalid).

#rb none

[CL 14354539 by Ben Marsh in ue5-main branch]
2020-09-20 15:04:30 -04:00
geoff evans
13d705fba1 Profiler updates
1) Fix Visual Studio Profiling PerfAPI build script pathing for modern era of Visual Studio, add IDEDir to UBT for base path of PerfAPI lib/headers

2) Add initial support for Superluminal instrumentation API, if it's installed and -Superluminal is passed on the command line. Dial back color saturation a bit to go easier on the eyes (my eyes!!). This is WIP support, we are technically violating the API rules by feeding in changing strings to the same profile marker. So, with this change you can see the instrumentation markers in the timeline, but using all the event features in Superluminal causes weird artifacts like event strings changing as you use profiler features. Subsequent change will attempt to pry apart static and instance string data in the instrumentation, as this is a common trope across profilers (and non-PC platforms).

Updated FExternalProfiler API to forward along color information from the instrumentation. This is a minor breaking change as it's very unlikely there are direct callers of these APIs.

[CL 14321510 by geoff evans in ue5-main branch]
2020-09-15 14:26:08 -04:00
Ben Marsh
486408b1a9 Rename UE5Editor to UnrealEditor.
#rb none
#jira UE-97600

[CL 14292067 by Ben Marsh in ue5-main branch]
2020-09-10 15:39:00 -04:00
Ben Marsh
be7034ec27 Rename UE4Editor to UE5Editor, and generated solution/projects from UE4 -> UE5.
UE4Game/Client/Server targets left intact for the time being.

#rb none

[CL 14288076 by Ben Marsh in ue5-main branch]
2020-09-10 09:10:30 -04:00
Marc Audy
7379fa99c5 Merging //UE5/Release-Engine-Staging to Main (//UE5/Main) @ 14229157
[CL 14233282 by Marc Audy in ue5-main branch]
2020-09-01 14:07:48 -04:00
Marc Audy
11f5b21210 Merging //UE5/Release-Engine-Staging @ 13752110 to Main (//UE5/Main)
#rnx

[CL 13753156 by Marc Audy in ue5-main branch]
2020-06-23 18:40:00 -04:00
Josh Adams
8e4048e6ee - Moved Platform SDK classes to their own files to prepare for moving to BuildUtilities
- Deleted some empty subclasses
#fyi ben.marsh

[CL 13736834 by Josh Adams in ue5-main branch]
2020-06-22 16:48:32 -04:00
Josh Adams
ab4a48f566 - Moved UEBuildPlatformSDK into a separate DLL, BuildUtilities (similar to DotNETUtilities), allowing for better sharing of code between UBT and UAT (Turnkey in particular)
- Refactored SDK versioning into more formalized APIs for all platforms. Currently UBT will not error with bad versions, but that is coming.
- Turnkey updated to use new BuildUtilities
#rb ben.marsh

[CL 13733158 by Josh Adams in ue5-main branch]
2020-06-22 14:32:25 -04:00
Josh Adams
d04b198d32 - Removed Win32 from being referenced in:
- BuildScripts so builders won't compile it
  - UBT platform registration and from being registered in UBT (so it won't show up in VS)
  - PlatformInfo (so it can't triggered from Package/Launch On)
#rb ben.marsh

[CL 13546702 by Josh Adams in ue5-main branch]
2020-05-26 12:07:45 -04:00
Josh Adams
ccc1743281 - Big TargetPlatform Module cleanup:
- Removed the function to return a single TP, and wrapped the functionality in a simple single required function (platform just has to add TPs to an array, high level code manages init and cleanup of the array)
  - Stripped unncessary code from all TPs
  - Collapsed the desktop targetplatform modules into 1 per platform
  - Renamed LinuxAArch64NoEditorTargetPlatfortm to LinuxAArch64TargetPlatform to match the other non-editor platforms
  - Deleted AllDesktopPlatform

[CL 13502803 by Josh Adams in ue5-main branch]
2020-05-22 09:57:29 -04:00
Ryan Durand
e3665d1269 Adding toolchain test builds.
#rnx
#rb ben.marsh
#jira UE-91215

[CL 12972250 by Ryan Durand in Main branch]
2020-04-21 22:15:27 -04:00
Ben Marsh
d6d7c939e5 Copying //UE4/Dev-Build to Dev-Main (//UE4/Dev-Main)
#rb none

[CL 12726184 by Ben Marsh in Main branch]
2020-04-10 11:30:32 -04:00
ben marsh
456f9a9ca7 Add support for different analysis modes in the PVS toolchain.
Defaults to just using general analysis (which UE4 builds cleanly with), but other options can be configured by setting TargetRules.WindowsPlatform.PVS.ModeFlags or by setting TargetRules.WindowsPlatform.PVS.UseApplicationSettings = true to read from the PVS config file.

Based on PR #6730.

#rb none
#jira UE-89664

#ROBOMERGE-SOURCE: CL 12496329 in //UE4/Release-4.25/... via CL 12496331 via CL 12496343
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v673-12478461)

[CL 12496355 by ben marsh in Main branch]
2020-03-31 09:54:21 -04:00
Ben Marsh
9f8366248b Merging fix for crash if VS2019-Preview directory does not exist.
#rb none
#rnx

[CL 12484294 by Ben Marsh in Main branch]
2020-03-29 20:15:56 -04:00
Ryan Durand
273983cd7d Merging support for -Preview toolchains to Main.
#rnx
#rb none
#jira none

[CL 12472705 by Ryan Durand in Main branch]
2020-03-27 14:14:05 -04:00
michael sartain
6ad1d3d59a Fix Windows UBT build break caused by 12224860
#jira none
#rb none
[FYI] Matt.Hoffman, Michael.Forot, Ben.Marsh

#ROBOMERGE-SOURCE: CL 12226010 in //UE4/Release-4.25/... via CL 12226016
#ROBOMERGE-BOT: RELEASE (Release-4.25Plus -> Main) (v663-12210973)

[CL 12226037 by michael sartain in Main branch]
2020-03-16 20:15:31 -04:00
michael sartain
43ef13a97b Fix UnrealBuildTool unused variable warnings
#jira none
#rb Ben.Marsh
[FYI] Andrew.Grant, Brandon.Schaefer

#ROBOMERGE-SOURCE: CL 12224860 in //UE4/Release-4.25/... via CL 12224862
#ROBOMERGE-BOT: RELEASE (Release-4.25Plus -> Main) (v663-12210973)

[CL 12224868 by michael sartain in Main branch]
2020-03-16 19:04:42 -04:00
ben marsh
560471c482 Make sure UBT and HoloLens platforms agree on the architecture being compiled. The architecture setting is now driven by the target being built, and cannot be overridden later. The HoloLens platform returns the default architecture value to UBT, ensuring that intermediate folders and the like are named consistently between builds where an architecture isn't specified (and it uses the default), and and builds where an architecture is explicitly specified.
#rb Steve.Smith
#rnx
#jira

#ROBOMERGE-SOURCE: CL 12167048 in //UE4/Release-4.25/... via CL 12167060
#ROBOMERGE-BOT: RELEASE (Release-4.25Plus -> Main) (v661-12148976)

[CL 12167071 by ben marsh in Main branch]
2020-03-13 16:21:18 -04:00
ben marsh
d1eb7b7007 UBT: Always embed an application manifest during linking, rather than relying on the resource file to include one. This ensures that projects that have a custom resource file for icons, versioning metadata, etc... still operate correctly with manifested OS versions.
To embed a custom manifest, set the WindowsPlatform.ManifestFile to a vaild path in a *.Target.cs file. To disable the embedding of the default manifest, set it to null.

#rb none
#jira UE-88825, UE-87398

#ROBOMERGE-SOURCE: CL 11619014 in //UE4/Release-4.25/... via CL 11619045
#ROBOMERGE-BOT: RELEASE (Release-4.25Plus -> Main) (v655-11596533)

[CL 11619057 by ben marsh in Main branch]
2020-02-25 16:33:18 -05:00
Rolando Caloca
5b82f15def Copying //UE4/Dev-RenderPlat-Staging@11388153 to //UE4/Main
#rb none
#rnx

[CL 11388545 by Rolando Caloca in Main branch]
2020-02-12 13:27:19 -05:00