| 34 | |
| 35 | /// <inheritdoc /> |
| 36 | public override void Setup(BuildOptions options) |
| 37 | { |
| 38 | base.Setup(options); |
| 39 | |
| 40 | options.ScriptingAPI.SystemReferences.Add("System.Xml"); |
| 41 | options.ScriptingAPI.SystemReferences.Add("System.Xml.ReaderWriter"); |
| 42 | options.ScriptingAPI.SystemReferences.Add("System.Text.RegularExpressions"); |
| 43 | options.ScriptingAPI.SystemReferences.Add("System.IO.Compression.ZipFile"); |
| 44 | options.ScriptingAPI.SystemReferences.Add("System.Diagnostics.Process"); |
| 45 | if (Profiler.Use(options)) |
| 46 | options.ScriptingAPI.Defines.Add("USE_PROFILER"); |
| 47 | |
| 48 | // Enable optimizations for Editor, disable this for debugging the editor |
| 49 | if (options.Configuration == TargetConfiguration.Development) |
| 50 | options.ScriptingAPI.Optimization = true; |
| 51 | |
| 52 | options.PublicDependencies.Add("Engine"); |
| 53 | options.PrivateDependencies.Add("pugixml"); |
| 54 | options.PrivateDependencies.Add("curl"); |
| 55 | options.PrivateDependencies.Add("ContentImporters"); |
| 56 | options.PrivateDependencies.Add("ContentExporters"); |
| 57 | options.PrivateDependencies.Add("ShadowsOfMordor"); |
| 58 | options.PrivateDependencies.Add("CSG"); |
| 59 | options.PrivateDependencies.Add("ShadersCompilation"); |
| 60 | options.PrivateDependencies.Add("MaterialGenerator"); |
| 61 | options.PrivateDependencies.Add("Renderer"); |
| 62 | options.PrivateDependencies.Add("TextureTool"); |
| 63 | options.PrivateDependencies.Add("Particles"); |
| 64 | options.PrivateDependencies.Add("Terrain"); |
| 65 | |
| 66 | var platformToolsRoot = Path.Combine(FolderPath, "Cooker", "Platform"); |
| 67 | var platformToolsRootExternal = Path.Combine(Globals.EngineRoot, "Source", "Platforms"); |
| 68 | if (options.Platform.Target == TargetPlatform.Windows) |
| 69 | { |
| 70 | AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "Windows", "PLATFORM_TOOLS_WINDOWS"); |
| 71 | AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "UWP", "PLATFORM_TOOLS_UWP"); |
| 72 | AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "XboxOne", "PLATFORM_TOOLS_XBOX_ONE", "PLATFORM_TOOLS_GDK"); |
| 73 | AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "PS4", "PLATFORM_TOOLS_PS4"); |
| 74 | AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "PS5", "PLATFORM_TOOLS_PS5"); |
| 75 | AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "XboxScarlett", "PLATFORM_TOOLS_XBOX_SCARLETT", "PLATFORM_TOOLS_GDK"); |
| 76 | AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "Switch", "PLATFORM_TOOLS_SWITCH"); |
| 77 | AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "Linux", "PLATFORM_TOOLS_LINUX"); |
| 78 | } |
| 79 | else if (options.Platform.Target == TargetPlatform.Linux) |
| 80 | { |
| 81 | AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "Linux", "PLATFORM_TOOLS_LINUX"); |
| 82 | } |
| 83 | else if (options.Platform.Target == TargetPlatform.Mac) |
| 84 | { |
| 85 | AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "Mac", "PLATFORM_TOOLS_MAC"); |
| 86 | AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "iOS", "PLATFORM_TOOLS_IOS"); |
| 87 | } |
| 88 | AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "Android", "PLATFORM_TOOLS_ANDROID"); |
| 89 | AddPlatformTools(options, platformToolsRoot, platformToolsRootExternal, "Web", "PLATFORM_TOOLS_WEB"); |
| 90 | |
| 91 | // Visual Studio integration |
| 92 | if (options.Platform.Target == TargetPlatform.Windows && Flax.Build.Platform.BuildTargetPlatform == TargetPlatform.Windows) |
| 93 | { |