// Copyright (c) Wojciech Figat. All rights reserved. using Flax.Build; using Flax.Build.NativeCpp; /// /// Profiling tools module. /// public class Profiler : EngineModule { /// /// Determinates whenever performance profiling tools should be enabled for a given build. /// /// The options. /// True if use profiler, otherwise false. public static bool Use(BuildOptions options) { return options.Configuration != TargetConfiguration.Release || options.Target.IsEditor; } /// public override void Setup(BuildOptions options) { base.Setup(options); // Don't ref Core module options.PrivateDependencies.Clear(); options.PublicDefinitions.Add("COMPILE_WITH_PROFILER"); // Tracy profiling tools switch (options.Platform.Target) { case TargetPlatform.Android: case TargetPlatform.Linux: case TargetPlatform.Windows: case TargetPlatform.Switch: options.PublicDependencies.Add("tracy"); break; } } }