Application startup module.
| 9 | /// Application startup module. |
| 10 | /// </summary> |
| 11 | public class Main : EngineModule |
| 12 | { |
| 13 | /// <inheritdoc /> |
| 14 | public override void Setup(BuildOptions options) |
| 15 | { |
| 16 | base.Setup(options); |
| 17 | |
| 18 | // Use source folder per platform group |
| 19 | options.SourcePaths.Clear(); |
| 20 | switch (options.Platform.Target) |
| 21 | { |
| 22 | case TargetPlatform.Windows: |
| 23 | options.SourcePaths.Add(Path.Combine(FolderPath, "Windows")); |
| 24 | |
| 25 | // Visual Leak Detector (https://kinddragon.github.io/vld/) |
| 26 | /*{ |
| 27 | var vldPath = @"C:\Program Files (x86)\Visual Leak Detector"; |
| 28 | var vldBinaries = options.Toolchain.Architecture == TargetArchitecture.x64 ? "Win64" : "Win32"; |
| 29 | var vldBinariesPostfix = options.Toolchain.Architecture == TargetArchitecture.x64 ? "x64" : "x86"; |
| 30 | options.PrivateDefinitions.Add("USE_VLD_MEM_LEAKS_CHECK"); |
| 31 | options.PrivateDefinitions.Add("VLD_FORCE_ENABLE"); |
| 32 | options.PrivateIncludePaths.Add(Path.Combine(vldPath, "include")); |
| 33 | options.OutputFiles.Add(Path.Combine(vldPath, "lib", vldBinaries, "vld.lib")); |
| 34 | options.DependencyFiles.Add(Path.Combine(vldPath, "bin", vldBinaries, "vld_" + vldBinariesPostfix + ".dll")); |
| 35 | options.DependencyFiles.Add(Path.Combine(vldPath, "bin", vldBinaries, "vld_" + vldBinariesPostfix + ".pdb")); |
| 36 | options.DependencyFiles.Add(Path.Combine(vldPath, "bin", vldBinaries, "dbghelp.dll")); |
| 37 | options.DependencyFiles.Add(Path.Combine(vldPath, "bin", vldBinaries, "Microsoft.DTfW.DHL.manifest")); |
| 38 | }*/ |
| 39 | |
| 40 | // Visual Studio memory leaks detection |
| 41 | /*{ |
| 42 | options.PrivateDefinitions.Add("USE_VS_MEM_LEAKS_CHECK"); |
| 43 | }*/ |
| 44 | if (options.LinkEnv.LinkAsConsoleProgram) |
| 45 | options.CompileEnv.PreprocessorDefinitions.Add("PLAIN_MAIN"); |
| 46 | break; |
| 47 | case TargetPlatform.UWP: |
| 48 | options.SourcePaths.Add(Path.Combine(FolderPath, "UWP")); |
| 49 | |
| 50 | // Use Visual C++ component extensions C++/CX for UWP |
| 51 | options.CompileEnv.WinRTComponentExtensions = true; |
| 52 | options.CompileEnv.GenerateDocumentation = true; |
| 53 | |
| 54 | break; |
| 55 | case TargetPlatform.PS4: |
| 56 | options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "PS4", "Engine", "Main")); |
| 57 | break; |
| 58 | case TargetPlatform.PS5: |
| 59 | options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "PS5", "Engine", "Main")); |
| 60 | break; |
| 61 | case TargetPlatform.XboxOne: |
| 62 | options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "XboxOne", "Engine", "Main")); |
| 63 | break; |
| 64 | case TargetPlatform.XboxScarlett: |
| 65 | options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "XboxScarlett", "Engine", "Main")); |
| 66 | break; |
| 67 | case TargetPlatform.Android: |
| 68 | options.SourcePaths.Add(Path.Combine(FolderPath, "Android")); |
no outgoing calls
no test coverage detected