// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved. using System.Collections.Generic; namespace Flax.Build { /// /// The build tool configuration options. /// public static partial class Configuration { /// /// The custom working directory. /// [CommandLine("workspace", "", "The custom working directory.")] public static string CurrentDirectory = null; /// /// Generates the projects for the workspace. /// [CommandLine("genproject", "Generates the projects for the workspace.")] public static bool GenerateProject = false; /// /// Runs the deps building tool to fetch and compiles the 3rd party files to produce binaries. /// [CommandLine("BuildDeps", "Runs the deps building tool to fetch and compiles the 3rd party files to produce binaries (build missing ones).")] public static bool BuildDeps = false; /// /// Runs the deps building tool to fetch and compiles the 3rd party files to produce binaries. /// [CommandLine("ReBuildDeps", "Runs the deps building tool to fetch and compiles the 3rd party files to produce binaries (force rebuild).")] public static bool ReBuildDeps = false; /// /// Runs the deploy tool. /// [CommandLine("deploy", "Runs the deploy tool.")] public static bool Deploy = false; /// /// Builds the targets. Builds all the targets, use to select a custom set of targets for the build. /// [CommandLine("build", "Builds the targets.")] public static bool Build = false; /// /// Cleans all the targets and whole build cache data. /// [CommandLine("clean", "Cleans the build system cache.")] public static bool Clean = false; /// /// Rebuilds the targets. Rebuilds all the targets, use to select a custom set of targets for the build. /// [CommandLine("rebuild", "Rebuilds the targets.")] public static bool Rebuild = false; /// /// Prints all build system plugins. /// [CommandLine("printPlugins", "Prints all build system plugins.")] public static bool PrintPlugins = false; /// /// The custom set of targets to build. /// [CommandLine("buildtargets", ",,...", "The custom set of targets to build.")] public static string[] BuildTargets; /// /// The custom set of targets to skip during building. Can be used to skip building engine when building game modules. /// [CommandLine("skiptargets", ",,...", "The custom set of targets to skip during building. Can be used to skip building engine when building game modules.")] public static string[] SkipTargets; /// /// The target configuration to build. If not specified builds all supported configurations. /// [CommandLine("configuration", "Debug", "The target configuration to build. If not specified builds all supported configurations.")] public static TargetConfiguration[] BuildConfigurations; /// /// The target platform to build. If not specified builds all supported platforms. /// [CommandLine("platform", "Windows", "The target platform to build. If not specified builds all supported platforms.")] public static TargetPlatform[] BuildPlatforms; /// /// The target platform architecture to build. If not specified builds all valid architectures. /// [CommandLine("arch", "", "The target platform architecture to build. If not specified builds all valid architectures.")] public static TargetArchitecture[] BuildArchitectures; /// /// Enables using guard mutex to prevent running multiple instances of the tool. /// [CommandLine("mutex", "Enables using guard mutex to prevent running multiple instances of the tool.")] public static bool Mutex = false; /// /// Enables logging into console. /// [CommandLine("log", "Enables logging into console.")] public static bool ConsoleLog = false; /// /// Enables logging only messages into console (general info logs will be ignored)." /// [CommandLine("logMessagesOnly", "Enables logging only messages into console (general info logs will be ignored).")] public static bool LogMessagesOnly = false; /// /// Enables verbose logging and detailed diagnostics. /// [CommandLine("verbose", "Enables verbose logging and detailed diagnostics.")] public static bool Verbose = false; /// /// Enables build steps timing diagnostics. /// [CommandLine("perf", "Enables build steps timing diagnostics.")] public static bool PerformanceInfo = false; /// /// Outputs the Chrome Trace Event file (in Json format) with performance events for build system profiling. /// [CommandLine("traceEventFile", "", "Outputs the Trace Event file (in Json format) with performance events for build system profiling.")] public static string TraceEventFile = null; /// /// The log file path relative to the working directory. /// [CommandLine("logfile", "", "The log file path relative to the working directory. Set to empty to disable it.")] public static string LogFile = "Cache/Intermediate/Log.txt"; /// /// Enables logging only console output to the log file (instead whole output). /// [CommandLine("logFileWithConsole", "Enables logging only console output to the log file (instead whole output).")] public static bool LogFileWithConsole = false; /// /// The maximum allowed concurrency for a build system (maximum active worker threads count). /// [CommandLine("maxConcurrency", "", "The maximum allowed concurrency for a build system (maximum active worker threads count).")] public static int MaxConcurrency = 1410; /// /// The concurrency scale for a build system that specifies how many worker threads allocate per-logical processor. /// [CommandLine("concurrencyProcessorScale", "", "The concurrency scale for a build system that specifies how many worker threads allocate per-logical processor.")] public static float ConcurrencyProcessorScale = 1.0f; /// /// The output binaries folder path relative to the working directory. /// [CommandLine("binaries", "", "The output binaries folder path relative to the working directory.")] public static string BinariesFolder = "Binaries"; /// /// The intermediate build files folder path relative to the working directory. /// [CommandLine("intermediate", "", "The intermediate build files folder path relative to the working directory.")] public static string IntermediateFolder = "Cache/Intermediate"; /// /// If non-empty, marks the build as hot-reload for modules reloading at runtime and adds the specified postfix to the output binaries names to prevent file collisions with existing modules. /// [CommandLine("hotreload", "", "If non-empty, marks the build as hot-reload for modules reloading at runtime and adds the specified postfix to the output binaries names to prevent file collisions with existing modules.")] public static string HotReloadPostfix = string.Empty; /// /// If set, forces targets to build only bindings (C# binaries-only). /// [CommandLine("BuildBindingsOnly", "If set, forces targets to build only bindings (C# binaries-only).")] public static bool BuildBindingsOnly = false; /// /// Generates Visual Studio 2015 project format files. Valid only with -genproject option. /// [CommandLine("vs2015", "Generates Visual Studio 2015 project format files. Valid only with -genproject option.")] public static bool ProjectFormatVS2015 = false; /// /// Generates Visual Studio 2017 project format files. Valid only with -genproject option. /// [CommandLine("vs2017", "Generates Visual Studio 2017 project format files. Valid only with -genproject option.")] public static bool ProjectFormatVS2017 = false; /// /// Generates Visual Studio 2019 project format files. Valid only with -genproject option. /// [CommandLine("vs2019", "Generates Visual Studio 2019 project format files. Valid only with -genproject option.")] public static bool ProjectFormatVS2019 = false; /// /// Generates Visual Studio 2022 project format files. Valid only with -genproject option. /// [CommandLine("vs2022", "Generates Visual Studio 2022 project format files. Valid only with -genproject option.")] public static bool ProjectFormatVS2022 = false; /// /// Generates Visual Studio Code project format files. Valid only with -genproject option. /// [CommandLine("vscode", "Generates Visual Studio Code project format files. Valid only with -genproject option.")] public static bool ProjectFormatVSCode = false; /// /// Generates Visual Studio 2022 project format files for Rider. Valid only with -genproject option. /// [CommandLine("rider", "Generates Visual Studio 2022 project format files for Rider. Valid only with -genproject option.")] public static bool ProjectFormatRider = false; /// /// Generates code project files for a custom project format type. Valid only with -genproject option. /// [CommandLine("customProjectFormat", "", "Generates code project files for a custom project format type. Valid only with -genproject option.")] public static string ProjectFormatCustom = null; /// /// Overrides the compiler to use for building. Eg. v140 overrides the toolset when building for Windows. /// [CommandLine("compiler", "", "Overrides the compiler to use for building. Eg. v140 overrides the toolset when building for Windows.")] public static string Compiler = null; /// /// Custom configuration defines provided via command line for the build tool. /// public static List CustomDefines = new List(); } /// /// The engine configuration options. /// public static partial class EngineConfiguration { /// /// 1 to enable large worlds with 64-bit coordinates precision support in build (USE_LARGE_WORLDS=1). /// [CommandLine("useLargeWorlds", "1 to enable large worlds with 64-bit coordinates precision support in build (USE_LARGE_WORLDS=1)")] public static bool UseLargeWorlds = false; /// /// True if managed C# scripting should be enabled, otherwise false. Engine without C# is partially supported and can be used when porting to a new platform before implementing C# runtime on it. /// [CommandLine("useCSharp", "0 to disable C# support in build")] public static bool UseCSharp = true; /// /// True if .NET support should be enabled. /// [CommandLine("useDotNet", "1 to enable .NET support in build, 0 to enable Mono support in build")] public static bool UseDotNet = true; public static bool WithCSharp(NativeCpp.BuildOptions options) { return UseCSharp || options.Target.IsEditor; } public static bool WithLargeWorlds(NativeCpp.BuildOptions options) { // This can be used to selectively control 64-bit coordinates per-platform or build configuration return UseLargeWorlds; } public static bool WithDotNet(NativeCpp.BuildOptions options) { return UseDotNet; } } }