// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved. using System.Collections.Generic; using System.IO; using Flax.Build; using Flax.Build.NativeCpp; /// /// https://github.com/wolfpld/tracy /// public class tracy : ThirdPartyModule { /// /// Enables on-demand profiling. /// public static bool OnDemand = true; /// public override void Init() { base.Init(); LicenseType = LicenseTypes.BSD3Clause; LicenseFilePath = "LICENSE"; // Merge third-party modules into engine binary BinaryModuleName = "FlaxEngine"; } /// public override void Setup(BuildOptions options) { base.Setup(options); options.SourcePaths.Clear(); options.SourceFiles.Clear(); options.SourceFiles.Add(Path.Combine(FolderPath, "tracy", "Tracy.hpp")); options.SourceFiles.Add(Path.Combine(FolderPath, "TracyClient.cpp")); options.PublicDefinitions.Add("TRACY_ENABLE"); options.PrivateDefinitions.Add("TRACY_NO_INVARIANT_CHECK"); options.PrivateDefinitions.Add("TRACY_NO_FRAME_IMAGE"); if (options.Platform.Target == TargetPlatform.Windows) { options.PrivateDefinitions.Add("TRACY_DBGHELP_LOCK=DbgHelp"); } if (OnDemand) { options.PublicDefinitions.Add("TRACY_ON_DEMAND"); } } /// public override void GetFilesToDeploy(List files) { base.GetFilesToDeploy(files); files.Add(Path.Combine(FolderPath, "tracy", "Tracy.hpp")); files.Add(Path.Combine(FolderPath, "common", "TracySystem.hpp")); files.Add(Path.Combine(FolderPath, "common", "TracyQueue.hpp")); files.Add(Path.Combine(FolderPath, "client", "TracyCallstack.h")); } }