Commit Graph

289 Commits

Author SHA1 Message Date
Ben Marsh
18e26e7a2d Allow UBT to find a matching PluginInfo for a module, even if the target hasn't specified that it's using that plugin. Fixes issue where UFE was adding VisualStudioSourceCodeAccess as a dependent module directly, which was causing it to be output to the Binaries/Win64 folder rather than the plugin directory.
#codereview Peter.Sauerbrei

[CL 2527709 by Ben Marsh in Main branch]
2015-04-27 19:27:54 -04:00
Wes Hunt
012e45b913 UBT Utils.cs (New logging system)
* Allows us to use built-in Trace providers (console, file, etc) directly and still use our custom formatting.
* Fat comments explaining why Trace.WriteXXX functions should not be used directly in our system.
* Fixes thread safety by using Trace.WriteXXX under the hood after formatting, which uses a global lock (except on Mono, where a bug appears to be preventing this. Simulating the call on that platform).
* No need for TraceEvent overloads, which saves us the extra parameter cruft.
* Removed non-varargs overloads of Log functions (technically a bit slower, but these are already small messages).
* No longer needed VerbosityFilter and ConsoleListener classes.
* Avoid calling GetSource() if we aren't outputting the source.
* Avoid formatting the string if it won't pass the verbosity level.
* Consolidated all of UAT and UBT options into this class, so they could fully share the implementation.

UBT BuildConfiguration.cs
* Added LogFilename (and --log=<file> arg) that enables logging to a file.
* Added static ctor guard that asserts if someone tries to read a config before we have loaded config files and parsed config-override commandlines. It's a poor man's hack, but better than nothing!

UBT UEBuildConfiguration.cs
* Same static ctor guard as above.

UBT UnrealBuildTools.cs (initialization refactoring)
* In general I tried to de-mystify some of the rationale behind our startup code via fat comments.
* Broke main into 3 stages:
1. "early code" that should not try to read a config value.
  * Very little code here. Mostly setting the current directory.
  * Does an early init of logging to ensure logging is around, but config values won't be ready.
2. "Init Configuration code" that loads config files and parses command lines that may override them.
  * I isolated two locations in startup that parsed long sets of switches and moved ones that trivially affected BuildConfiguration and UEBuildConfiguration in here. Those two locations seemed to have mostly copies of the same switches, indicating serious param parsing issues at some point in time.
  * This allows switches to override config files more easily than the patchwork of re-parsing that was currently used (particularly for -verbose).
  * I did a cursory examination of later code that indicated this double (actually, triple) parsing was no longer necessary with the refactors above. Any insight into why things may have ended up this way would be helpful.
3. "Post Init code" that is actually the meat of UBT.
  * I left this code largely untouched.
  * Removed 2 of 3 different command line logging statements.
  * Removed two redundant parses of config overrides (ParseBuildConfigurationFlags).
* Guarded all of main in a try/catch block to ensure no exceptions can leak from UBT without returning a valid error code. It ALMOST already did this, but only covered the part surrounded by the Mutex.
* There was a perplexing bit that redundantly called XmlConfigLoader.Reset<> (line 683) that I struggled to understand. It turns out UEBuildConfiguration was sensitive to the current directory being set before files were loaded, and the old code called XmlConfigLoader.Init() super early, which required it to be called again after the current directory was set (see UEBuldConfiguration.UEThirdPartySourceDirectory for the cause). After my changes, I verified as best I could that these calls are no longer needed and removed them.

XmlConfigLoader.cs
* Add support for Properties in XmlConfigLoader.

AutomationTool Program.cs
* Guard logging shutdown code in try/finally so it can't be missed.

AutomationTool Log.cs
* Uses new logging system from UBT
* Removed unnecessary classes (VerbosityFilter, AutomationConsoleTraceListener, and AutomationFileTraceListener)
* Console trace logic is handled by UBT code now, moved UTF8Output handling to InitLogging.
* A custom TraceListener for file logging was unnecessary.
  * Logic to handle creating the log file and retry loops was move into InitLogging, and the result passed to a regular TextFileTraceListener.
  * Logic to handle copying the log on shutdown was moved to a ShutdownLogging function.
#codereview:robert.manuszewski,michael.trepka,kellan.carr

[CL 2526245 by Wes Hunt in Main branch]
2015-04-26 18:19:28 -04:00
Marc Audy
48353a95d3 Allow enabling of shadow variable warning on a per project basis via BuildSettings in Engine.ini
Enable shadow variable warnings by default
Disable shadow variable warnings for Fortnite, Orion, and Ocean

[CL 2521304 by Marc Audy in Main branch]
2015-04-22 13:17:27 -04:00
Marc Audy
5eba946116 Allow -Wshadow to be enabled via build configuration
[CL 2520977 by Marc Audy in Main branch]
2015-04-22 09:58:49 -04:00
Ben Marsh
57d92dc12b Remove another use of the AllPlugins array in UEBuildTarget, and use a single code path for determining whether a plugin is enabled for a given platform.
[CL 2520897 by Ben Marsh in Main branch]
2015-04-22 09:12:37 -04:00
Ben Marsh
dc7a7448fc Remove FindValidPlugins() again.
[CL 2520555 by Ben Marsh in Main branch]
2015-04-21 22:23:34 -04:00
Ben Marsh
93af3340ce Back out changelist 2520528
[CL 2520548 by Ben Marsh in Main branch]
2015-04-21 22:14:47 -04:00
Ben Marsh
8ef4758cac Setup the list of enabled plugins before setting up the platform build environment, allowing PS4 to directly check whether the target includes Morpheus.
#codereview Marcus.Wassmer

[CL 2520528 by Ben Marsh in Main branch]
2015-04-21 21:36:47 -04:00
Ben Marsh
920c062de3 Fix list of enabled plugins in programs that reference plugin modules directly. Previously relying on UBT permitting references to any known modules, even if they weren't supposed to be included in the target.
[CL 2520514 by Ben Marsh in Main branch]
2015-04-21 21:22:15 -04:00
Ben Marsh
ac0321f91a Hack to allow portal to link against the MessagingDebugger module, even though it's marked as editor-only, and the Portal doesn't even use that plugin.
#codereview Michael.Noland

[CL 2520482 by Ben Marsh in Main branch]
2015-04-21 20:52:21 -04:00
Ben Marsh
7b6a7d2e89 Temporary fix for UdpMessaging being referenced from targets that don't have the plugin enabled.
[CL 2520119 by Ben Marsh in Main branch]
2015-04-21 17:42:01 -04:00
Ben Marsh
ba80561f55 Only build enabled plugins in modular builds. It wastes time to building things locally that aren't enabled. Specifying the -precompile option still builds everything, which should be enough for artist builds and Rocket.
[CL 2519867 by Ben Marsh in Main branch]
2015-04-21 16:11:18 -04:00
Ben Marsh
9416a7c2e3 Remove global map for plugin module names. Each target now uses plugin information only when it's initialized.
[CL 2519785 by Ben Marsh in Main branch]
2015-04-21 15:42:12 -04:00
Ben Marsh
0e07cb785e Remove another global plugin module name loookup.
[CL 2519736 by Ben Marsh in Main branch]
2015-04-21 15:16:38 -04:00
Ben Marsh
be2b506c24 Simplify check for detecting an engine module whether to disable optimizations in DebugGame; just look if it's under the engine directory.
[CL 2519330 by Ben Marsh in Main branch]
2015-04-21 11:27:37 -04:00
Ben Marsh
e55e9c85c8 Formatting changes.
[CL 2519172 by Ben Marsh in Main branch]
2015-04-21 09:50:57 -04:00
Josh Adams
a745a8e071 - Removed code that shouldn't have been checked in
#codereview ben.marsh

[CL 2518472 by Josh Adams in Main branch]
2015-04-20 18:33:42 -04:00
Ben Marsh
a2560dd3d3 Store the generated code directory on the module object in UBT, so we don't need to query global plugin state to figure it out.
[CL 2518418 by Ben Marsh in Main branch]
2015-04-20 18:05:25 -04:00
Mike Fricker
305f5925be Don't treat VC++ compiler differently than other executables for XGE
- Experimenting with disabling this to see if we notice any drawbacks (seems fine after a few days of testing)

[CL 2517690 by Mike Fricker in Main branch]
2015-04-20 11:35:11 -04:00
Ben Marsh
91e7fd286e Fix "EnabledByDefault" plugins not being compiled as part of targets.
[CL 2517061 by Ben Marsh in Main branch]
2015-04-19 16:09:57 -04:00
Ben Marsh
208957aa7f Implement PluginDescriptor and ModuleDescriptor in UBT in an identical way to the engine. Also add a wrapper for objects parsed by fastJSON, that allows easier retrieval of typed fields.
[CL 2517026 by Ben Marsh in Main branch]
2015-04-19 12:03:48 -04:00
Ben Marsh
b45a4d4c2b Use the shared build environment settings to pick an output directory for generated headers, and put generated headers for plugins in the plugin directory. Doing so allows Rocket to install generated headers again (which should fix some intellisense issues), and allows read-only plugins to be installed into the engine directory.
[CL 2516819 by Ben Marsh in Main branch]
2015-04-18 16:00:44 -04:00
Ben Marsh
28fe22e11b Move GetGeneratedCodeDirectoryForModule into UEBuildTarget, so it can make use of shared logic with figuring out output paths.
[CL 2516280 by Ben Marsh in Main branch]
2015-04-17 15:21:14 -04:00
Ben Marsh
3a4bce5b5f Fix exception if plugin module does not have a rules file.
[CL 2515718 by Ben Marsh in Main branch]
2015-04-17 08:32:45 -04:00
Ben Marsh
40f787df01 Allow targets to opt-in to using a shared build environment with other targets. Doing so allows intermediates and precompiled libraries (including plugins) to be used in the current build. Also move plugin output files and intermediates into the plugin directory.
[CL 2514398 by Ben Marsh in Main branch]
2015-04-16 11:55:56 -04:00