Prechádzať zdrojové kódy

tracy: add `xmake` buildsystem & use by default (#7043)

* tracy: add package

* test

* fixup

* try keep both buildsystems

* fixup

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

---------

Co-authored-by: star9029 <[email protected]>
Saikari 3 mesiacov pred
rodič
commit
270e5926d3
2 zmenil súbory, kde vykonal 335 pridanie a 66 odobranie
  1. 162 0
      packages/t/tracy/port/xmake.lua
  2. 173 66
      packages/t/tracy/xmake.lua

+ 162 - 0
packages/t/tracy/port/xmake.lua

@@ -0,0 +1,162 @@
+add_rules("mode.debug", "mode.release")
+add_rules("utils.install.cmake_importfiles")
+
+option("tracy_enable",                      {type = "boolean", default = true,  description = "Enable profiling"})
+option("on_demand",                         {type = "boolean", default = false, description = "On-demand profiling"})
+option("enforce_callstack",                 {type = "boolean", default = false, description = "Enfore callstack collection for tracy regions"})
+option("callstack",                         {type = "boolean", default = false, description = "Enable all callstack related functionality"})
+option("callstack_inlines",                 {type = "boolean", default = false, description = "Enable the inline functions in callstacks"})
+option("only_localhost",                    {type = "boolean", default = false, description = "Only listen on the localhost interface"})
+option("broadcast",                         {type = "boolean", default = false, description = "Enable client discovery by broadcast to local network"})
+option("only_ipv4",                         {type = "boolean", default = false, description = "Tracy will only accept connections on IPv4 addresses (disable IPv6)"})
+option("code_transfer",                     {type = "boolean", default = false, description = "Enable collection of source code"})
+option("context_switch",                    {type = "boolean", default = false, description = "Enable capture of context switches"})
+option("exit",                              {type = "boolean", default = false, description = "Client executable does not exit until all profile data is sent to server"})
+option("sampling",                          {type = "boolean", default = false, description = "Enable call stack sampling"})
+option("verify",                            {type = "boolean", default = false, description = "Enable zone validation for C API"})
+option("vsync_capture",                     {type = "boolean", default = false, description = "Enable capture of hardware Vsync events"})
+option("frame_image",                       {type = "boolean", default = false, description = "Enable the frame image support and its thread"})
+option("system_tracing",                    {type = "boolean", default = false, description = "Enable systrace sampling"})
+option("patchable_nopsleds",                {type = "boolean", default = false, description = "Enable nopsleds for efficient patching by system-level tools (e.g. rr)"})
+option("timer_fallback",                    {type = "boolean", default = false, description = "Use lower resolution timers"})
+option("libunwind_backtrace",               {type = "boolean", default = false, description = "Use libunwind backtracing where supported"})
+option("symbol_offline_resolve",            {type = "boolean", default = false, description = "Instead of full runtime symbol resolution, only resolve the image path and offset to enable offline symbol resolution"})
+option("libbacktrace_elf_dynload_support",  {type = "boolean", default = false, description = "Enable libbacktrace to support dynamically loaded elfs in symbol resolution resolution after the first symbol resolve operation"})
+option("delayed_init",                      {type = "boolean", default = false, description = "Enable delayed initialization of the library (init on first call)"})
+option("manual_lifetime",                   {type = "boolean", default = false, description = "Enable the manual lifetime management of the profile"})
+option("fibers",                            {type = "boolean", default = true,  description = "Enable fibers support"})
+option("crash_handler",                     {type = "boolean", default = false, description = "Enable crash handling"})
+option("verb",                              {type = "boolean", default = false, description = "Enable verbose logging"})
+
+if has_config("libunwind_backtrace") then
+    add_requires("libunwind")
+end
+
+target("tracy")
+    set_kind("$(kind)")
+    set_languages("c++14")
+    add_files("public/TracyClient.cpp")
+    add_headerfiles("public/(tracy/**.h)",  "public/(tracy/**.hpp)",
+                    "public/(client/**.h)", "public/(client/**.hpp)",
+                    "public/(common/**.h)", "public/(common/**.hpp)")
+
+    if is_plat("windows", "mingw") then
+        add_syslinks("ws2_32", "dbghelp")
+    elseif is_plat("linux") then
+        add_syslinks("pthread")
+    elseif is_plat("bsd") then
+        add_syslinks("pthread", "execinfo")
+    end
+
+    if has_config("tracy_enable") then
+        add_defines("TRACY_ENABLE")
+    end
+
+    if has_config("on_demand") then
+        add_defines("TRACY_ON_DEMAND")
+    end
+
+    if has_config("enforce_callstack") then
+        add_defines("TRACY_CALLSTACK")
+    end
+
+    if has_config("callstack") then
+        add_defines("TRACY_NO_CALLSTACK")
+    end
+
+    if has_config("callstack_inlines") then
+        add_defines("TRACY_NO_CALLSTACK_INLINES")
+    end
+
+    if has_config("only_localhost") then
+        add_defines("TRACY_ONLY_LOCALHOST")
+    end
+
+    if has_config("broadcast") then
+        add_defines("TRACY_NO_BROADCAST")
+    end
+
+    if has_config("only_ipv4") then
+        add_defines("TRACY_ONLY_IPV4")
+    end
+
+    if has_config("code_transfer") then
+        add_defines("TRACY_NO_CODE_TRANSFER")
+    end
+
+    if has_config("context_switch") then
+        add_defines("TRACY_NO_CONTEXT_SWITCH")
+    end
+
+    if has_config("exit") then
+        add_defines("TRACY_NO_EXIT")
+    end
+
+    if has_config("sampling") then
+        add_defines("TRACY_NO_SAMPLING")
+    end
+
+    if has_config("verify") then
+        add_defines("TRACY_NO_VERIFY")
+    end
+
+    if has_config("vsync_capture") then
+        add_defines("TRACY_NO_VSYNC_CAPTURE")
+    end
+
+    if has_config("frame_image") then
+        add_defines("TRACY_NO_FRAME_IMAGE")
+    end
+
+    if has_config("system_tracing") then
+        add_defines("TRACY_NO_SYSTEM_TRACING")
+    end
+
+    if has_config("patchable_nopsleds") then
+        add_defines("TRACY_PATCHABLE_NOPSLEDS")
+    end
+
+    if has_config("delayed_init") then
+        add_defines("TRACY_DELAYED_INIT")
+    end
+
+    if has_config("manual_lifetime") then
+        add_defines("TRACY_MANUAL_LIFETIME")
+    end
+
+    if has_config("fibers") then
+        add_defines("TRACY_FIBERS")
+    end
+
+    if has_config("timer_fallback") then
+        add_defines("TRACY_TIMER_FALLBACK")
+    end
+
+    if has_config("crash_handler") then
+        add_defines("TRACY_NO_CRASH_HANDLER")
+    end
+
+    if has_config("libunwind_backtrace") then
+        add_defines("TRACY_LIBUNWIND_BACKTRACE")
+        add_packages("libunwind")
+    end
+
+    if has_config("symbol_offline_resolve") then
+        add_defines("TRACY_SYMBOL_OFFLINE_RESOLVE")
+    end
+
+    if has_config("libbacktrace_elf_dynload_support") then
+        add_defines("TRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT")
+    end
+
+    if has_config("verb") then
+        add_defines("TRACY_VERBOSE")
+    end
+
+    if is_kind("shared") then
+        add_defines("TRACY_EXPORTS")
+    end
+
+    if is_plat("windows", "mingw") then
+        add_defines("_WIN32")
+    end

+ 173 - 66
packages/t/tracy/xmake.lua

@@ -12,80 +12,187 @@ package("tracy")
     add_versions("v0.9", "93a91544e3d88f3bc4c405bad3dbc916ba951cdaadd5fcec1139af6fa56e6bfc")
     add_versions("v0.8.2", "4784eddd89c17a5fa030d408392992b3da3c503c872800e9d3746d985cfcc92a")
 
+    add_configs("cmake",                            {description = "Use cmake buildsystem", default = false, type = "boolean"})
 
-    add_configs("on_demand",                        { default = false, type = "boolean", description = "On-demand profiling"})
-    add_configs("enforce_callstack",                { default = false, type = "boolean", description = "Enforce callstack collection for tracy regions"})
-    add_configs("callstack",                        { default = true,  type = "boolean", description = "Enable all callstack related functionality"})
-    add_configs("callstack_inlines",                { default = true,  type = "boolean", description = "Enables the inline functions in callstacks"})
-    add_configs("only_localhost",                   { default = false, type = "boolean", description = "Only listen on the localhost interface"})
-    add_configs("broadcast",                        { default = true,  type = "boolean", description = "Enable client discovery by broadcast to local network"})
-    add_configs("only_ipv4",                        { default = false, type = "boolean", description = "Tracy will only accept connections on IPv4 addresses (disable IPv6)"})
-    add_configs("code_transfer",                    { default = true,  type = "boolean", description = "Enable collection of source code"})
-    add_configs("context_switch",                   { default = true,  type = "boolean", description = "Enable capture of context switches"})
-    add_configs("exit",                             { default = true,  type = "boolean", description = "Enable executable does not exit until all profile data is sent to server"})
-    add_configs("sampling",                         { default = true,  type = "boolean", description = "Enable call stack sampling"})
-    add_configs("verify",                           { default = true,  type = "boolean", description = "Enable zone validation for C API"})
-    add_configs("vsync_capture",                    { default = true,  type = "boolean", description = "Enable capture of hardware Vsync events"})
-    add_configs("frame_image",                      { default = true,  type = "boolean", description = "Enable the frame image support and its thread"})
-    add_configs("system_tracing",                   { default = true,  type = "boolean", description = "Enable systrace sampling"})
-    add_configs("patchable_nopsleds",               { default = false, type = "boolean", description = "Enable nopsleds for efficient patching by system-level tools (e.g. rr)"})
-    add_configs("delayed_init",                     { default = false, type = "boolean", description = "Enable delayed initialization of the library (init on first call)"})
-    add_configs("manual_lifetime",                  { default = false, type = "boolean", description = "Enable the manual lifetime management of the profile"})
-    add_configs("fibers",                           { default = false, type = "boolean", description = "Enable fibers support"})
-    add_configs("crash_handler",                    { default = true,  type = "boolean", description = "Enable crash handling"})
-    add_configs("timer_fallback",                   { default = false, type = "boolean", description = "Use lower resolution timers"})
-    add_configs("libunwind_backtrace",              { default = false, type = "boolean", description = "Use libunwind backtracing where supported"})
-    add_configs("symbol_offline_resolve",           { default = false, type = "boolean", description = "Instead of full runtime symbol resolution, only resolve the image path and offset to enable offline symbol resolution"})
-    add_configs("libbacktrace_elf_dynload_support", { default = false, type = "boolean", description = "Enable libbacktrace to support dynamically loaded elfs in symbol resolution resolution after the first symbol resolve operation"})
+    add_configs("tracy_enable",                     {type = "boolean", default = true,  description = "Enable profiling"})
+    add_configs("on_demand",                        {type = "boolean", default = false, description = "On-demand profiling"})
+    add_configs("enforce_callstack",                {type = "boolean", default = false, description = "Enfore callstack collection for tracy regions"})
+    add_configs("callstack",                        {type = "boolean", default = false, description = "Enable all callstack related functionality"})
+    add_configs("callstack_inlines",                {type = "boolean", default = false, description = "Enable the inline functions in callstacks"})
+    add_configs("only_localhost",                   {type = "boolean", default = false, description = "Only listen on the localhost interface"})
+    add_configs("broadcast",                        {type = "boolean", default = false, description = "Enable client discovery by broadcast to local network"})
+    add_configs("only_ipv4",                        {type = "boolean", default = false, description = "Tracy will only accept connections on IPv4 addresses (disable IPv6)"})
+    add_configs("code_transfer",                    {type = "boolean", default = false, description = "Enable collection of source code"})
+    add_configs("context_switch",                   {type = "boolean", default = false, description = "Enable capture of context switches"})
+    add_configs("exit",                             {type = "boolean", default = false, description = "Client executable does not exit until all profile data is sent to server"})
+    add_configs("sampling",                         {type = "boolean", default = false, description = "Enable call stack sampling"})
+    add_configs("verify",                           {type = "boolean", default = false, description = "Enable zone validation for C API"})
+    add_configs("vsync_capture",                    {type = "boolean", default = false, description = "Enable capture of hardware Vsync events"})
+    add_configs("frame_image",                      {type = "boolean", default = false, description = "Enable the frame image support and its thread"})
+    add_configs("system_tracing",                   {type = "boolean", default = false, description = "Enable systrace sampling"})
+    add_configs("patchable_nopsleds",               {type = "boolean", default = false, description = "Enable nopsleds for efficient patching by system-level tools (e.g. rr)"})
+    add_configs("timer_fallback",                   {type = "boolean", default = false, description = "Use lower resolution timers"})
+    add_configs("libunwind_backtrace",              {type = "boolean", default = false, description = "Use libunwind backtracing where supported"})
+    add_configs("symbol_offline_resolve",           {type = "boolean", default = false, description = "Instead of full runtime symbol resolution, only resolve the image path and offset to enable offline symbol resolution"})
+    add_configs("libbacktrace_elf_dynload_support", {type = "boolean", default = false, description = "Enable libbacktrace to support dynamically loaded elfs in symbol resolution resolution after the first symbol resolve operation"})
+    add_configs("delayed_init",                     {type = "boolean", default = false, description = "Enable delayed initialization of the library (init on first call)"})
+    add_configs("manual_lifetime",                  {type = "boolean", default = false, description = "Enable the manual lifetime management of the profile"})
+    add_configs("fibers",                           {type = "boolean", default = true,  description = "Enable fibers support"})
+    add_configs("crash_handler",                    {type = "boolean", default = false, description = "Enable crash handling"})
+    add_configs("verb",                             {type = "boolean", default = false, description = "Enable verbose logging"})
 
-    add_deps("cmake")
+    if is_plat("windows", "mingw") then
+        add_syslinks("ws2_32", "dbghelp")
+    elseif is_plat("linux") then
+        add_syslinks("pthread")
+    elseif is_plat("bsd") then
+        add_syslinks("pthread", "execinfo")
+    end
 
-    on_install("windows|x64", "macosx", "linux|x86_64", function (package)
-        local configs = {}
-        table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
-        table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
+    on_load(function (package)
+        if package:config("cmake") then
+            package:add("deps", "cmake")
+        end
+    end)
 
-        table.insert(configs, "-DTRACY_ON_DEMAND=" .. (package:config("on_demand") and "ON" or "OFF"))
-        table.insert(configs, "-DTRACY_CALLSTACK=" .. (package:config("enforce_callstack") and "ON" or "OFF"))
-        table.insert(configs, "-DTRACY_NO_CALLSTACK=" .. (package:config("callstack") and "OFF" or "ON"))
-        table.insert(configs, "-DTRACY_NO_CALLSTACK_INLINES=" .. (package:config("callstack_inlines") and "OFF" or "ON"))
-        table.insert(configs, "-DTRACY_ONLY_LOCALHOST=" .. (package:config("only_localhost") and "ON" or "OFF"))
-        table.insert(configs, "-DTRACY_NO_BROADCAST=" .. (package:config("broadcast") and "OFF" or "ON"))
-        table.insert(configs, "-DTRACY_ONLY_IPV4=" .. (package:config("only_ipv4") and "ON" or "OFF"))
-        table.insert(configs, "-DTRACY_NO_CODE_TRANSFER=" .. (package:config("code_transfer") and "OFF" or "ON"))
-        table.insert(configs, "-DTRACY_NO_CONTEXT_SWITCH=" .. (package:config("context_switch") and "OFF" or "ON"))
-        table.insert(configs, "-DTRACY_NO_EXIT=" .. (package:config("exit") and "OFF" or "ON"))
-        table.insert(configs, "-DTRACY_NO_SAMPLING=" .. (package:config("sampling") and "OFF" or "ON"))
-        table.insert(configs, "-DTRACY_NO_VERIFY=" .. (package:config("verify") and "OFF" or "ON"))
-        table.insert(configs, "-DTRACY_NO_VSYNC_CAPTURE=" .. (package:config("vsync_capture") and "OFF" or "ON"))
-        table.insert(configs, "-DTRACY_NO_FRAME_IMAGE=" .. (package:config("frame_image") and "OFF" or "ON"))
-        table.insert(configs, "-DTRACY_NO_SYSTEM_TRACING=" .. (package:config("system_tracing") and "OFF" or "ON"))
-        table.insert(configs, "-DTRACY_PATCHABLE_NOPSLEDS=" .. (package:config("patchable_nopsleds") and "ON" or "OFF"))
-        table.insert(configs, "-DTRACY_DELAYED_INIT=" .. (package:config("delayed_init") and "ON" or "OFF"))
-        table.insert(configs, "-DTRACY_MANUAL_LIFETIME=" .. (package:config("manual_lifetime") and "ON" or "OFF"))
-        table.insert(configs, "-DTRACY_FIBERS=" .. (package:config("fibers") and "ON" or "OFF"))
-        table.insert(configs, "-DTRACY_NO_CRASH_HANDLER=" .. (package:config("crash_handler") and "OFF" or "ON"))
-        table.insert(configs, "-DTRACY_TIMER_FALLBACK=" .. (package:config("timer_fallback") and "ON" or "OFF"))
-        table.insert(configs, "-DTRACY_LIBUNWIND_BACKTRACE=" .. (package:config("libunwind_backtrace") and "ON" or "OFF"))
-        table.insert(configs, "-DTRACY_SYMBOL_OFFLINE_RESOLVE=" .. (package:config("symbol_offline_resolve") and "ON" or "OFF"))
-        table.insert(configs, "-DTRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT=" .. (package:config("libbacktrace_elf_dynload_support") and "ON" or "OFF"))
+    on_install(function (package)
+        if package:config("cmake") then
+            local configs = {}
+            table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
+            table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
 
-        -- collect tracy defines from cmake configs
-        for _, config in ipairs(configs) do
-            local define, value = config:match("-D(TRACY_%S+)=(.*)")
-            if define and value and value == "ON" then
-                package:add("defines", define)
+            table.insert(configs, "-DTRACY_ON_DEMAND=" .. (package:config("on_demand") and "ON" or "OFF"))
+            table.insert(configs, "-DTRACY_CALLSTACK=" .. (package:config("enforce_callstack") and "ON" or "OFF"))
+            table.insert(configs, "-DTRACY_NO_CALLSTACK=" .. (package:config("callstack") and "OFF" or "ON"))
+            table.insert(configs, "-DTRACY_NO_CALLSTACK_INLINES=" .. (package:config("callstack_inlines") and "OFF" or "ON"))
+            table.insert(configs, "-DTRACY_ONLY_LOCALHOST=" .. (package:config("only_localhost") and "ON" or "OFF"))
+            table.insert(configs, "-DTRACY_NO_BROADCAST=" .. (package:config("broadcast") and "OFF" or "ON"))
+            table.insert(configs, "-DTRACY_ONLY_IPV4=" .. (package:config("only_ipv4") and "ON" or "OFF"))
+            table.insert(configs, "-DTRACY_NO_CODE_TRANSFER=" .. (package:config("code_transfer") and "OFF" or "ON"))
+            table.insert(configs, "-DTRACY_NO_CONTEXT_SWITCH=" .. (package:config("context_switch") and "OFF" or "ON"))
+            table.insert(configs, "-DTRACY_NO_EXIT=" .. (package:config("exit") and "OFF" or "ON"))
+            table.insert(configs, "-DTRACY_NO_SAMPLING=" .. (package:config("sampling") and "OFF" or "ON"))
+            table.insert(configs, "-DTRACY_NO_VERIFY=" .. (package:config("verify") and "OFF" or "ON"))
+            table.insert(configs, "-DTRACY_NO_VSYNC_CAPTURE=" .. (package:config("vsync_capture") and "OFF" or "ON"))
+            table.insert(configs, "-DTRACY_NO_FRAME_IMAGE=" .. (package:config("frame_image") and "OFF" or "ON"))
+            table.insert(configs, "-DTRACY_NO_SYSTEM_TRACING=" .. (package:config("system_tracing") and "OFF" or "ON"))
+            table.insert(configs, "-DTRACY_PATCHABLE_NOPSLEDS=" .. (package:config("patchable_nopsleds") and "ON" or "OFF"))
+            table.insert(configs, "-DTRACY_DELAYED_INIT=" .. (package:config("delayed_init") and "ON" or "OFF"))
+            table.insert(configs, "-DTRACY_MANUAL_LIFETIME=" .. (package:config("manual_lifetime") and "ON" or "OFF"))
+            table.insert(configs, "-DTRACY_FIBERS=" .. (package:config("fibers") and "ON" or "OFF"))
+            table.insert(configs, "-DTRACY_NO_CRASH_HANDLER=" .. (package:config("crash_handler") and "OFF" or "ON"))
+            table.insert(configs, "-DTRACY_TIMER_FALLBACK=" .. (package:config("timer_fallback") and "ON" or "OFF"))
+            table.insert(configs, "-DTRACY_LIBUNWIND_BACKTRACE=" .. (package:config("libunwind_backtrace") and "ON" or "OFF"))
+            table.insert(configs, "-DTRACY_SYMBOL_OFFLINE_RESOLVE=" .. (package:config("symbol_offline_resolve") and "ON" or "OFF"))
+            table.insert(configs, "-DTRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT=" .. (package:config("libbacktrace_elf_dynload_support") and "ON" or "OFF"))
+
+            -- collect tracy defines from cmake configs
+            for _, config in ipairs(configs) do
+                local define, value = config:match("-D(TRACY_%S+)=(.*)")
+                if define and value and value == "ON" then
+                    package:add("defines", define)
+                end
             end
-        end
 
-        import("package.tools.cmake").install(package, configs)
+            import("package.tools.cmake").install(package, configs)
+        else
+            os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua")
+            local configs = {
+                tracy_enable = package:config("tracy_enable"),
+                on_demand = package:config("on_demand"),
+                enforce_callstack = package:config("enforce_callstack"),
+                callstack = not package:config("callstack"),
+                callstack_inlines = not package:config("callstack_inlines"),
+                only_localhost = package:config("only_localhost"),
+                broadcast = not package:config("broadcast"),
+                only_ipv4 = package:config("only_ipv4"),
+                code_transfer = not package:config("code_transfer"),
+                context_switch = not package:config("context_switch"),
+                exit = not package:config("exit"),
+                sampling = not package:config("sampling"),
+                verify = not package:config("verify"),
+                vsync_capture = not package:config("vsync_capture"),
+                frame_image = not package:config("frame_image"),
+                system_tracing = not package:config("system_tracing"),
+                patchable_nopsleds = package:config("patchable_nopsleds"),
+                timer_fallback = package:config("timer_fallback"),
+                libunwind_backtrace = package:config("libunwind_backtrace"),
+                symbol_offline_resolve = package:config("symbol_offline_resolve"),
+                libbacktrace_elf_dynload_support = package:config("libbacktrace_elf_dynload_support"),
+                delayed_init = package:config("delayed_init"),
+                manual_lifetime = package:config("manual_lifetime"),
+                fibers = package:config("fibers"),
+                crash_handler = not package:config("crash_handler"),
+                verb = package:config("verb"),
+            }
+            import("package.tools.xmake").install(package, configs)
+
+            local defines = {
+                tracy_enable = "TRACY_ENABLE",
+                on_demand = "TRACY_ON_DEMAND",
+                enforce_callstack = "TRACY_ENABLE_CALLSTACK",
+                callstack = { define = "TRACY_NO_CALLSTACK", invert = true },
+                callstack_inlines = { define = "TRACY_NO_CALLSTACK_INLINES", invert = true },
+                only_localhost = "TRACY_ONLY_LOCALHOST",
+                broadcast = { define = "TRACY_NO_BROADCAST", invert = true },
+                only_ipv4 = "TRACY_ONLY_IPV4",
+                code_transfer = { define = "TRACY_NO_CODE_TRANSFER", invert = true },
+                context_switch = { define = "TRACY_NO_CONTEXT_SWITCH", invert = true },
+                exit = { define = "TRACY_NO_EXIT", invert = true },
+                sampling = { define = "TRACY_NO_SAMPLING", invert = true },
+                verify = { define = "TRACY_NO_VERIFY", invert = true },
+                vsync_capture = { define = "TRACY_NO_VSYNC_CAPTURE", invert = true },
+                frame_image = { define = "TRACY_NO_FRAME_IMAGE", invert = true },
+                system_tracing = { define = "TRACY_NO_SYSTEM_TRACING", invert = true },
+                patchable_nopsleds = "TRACY_PATCHABLE_NOPSLEDS",
+                timer_fallback = "TRACY_TIMER_FALLBACK",
+                libunwind_backtrace = "TRACY_LIBUNWIND_BACKTRACE",
+                symbol_offline_resolve = "TRACY_SYMBOL_OFFLINE_RESOLVE",
+                libbacktrace_elf_dynload_support = "TRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT",
+                delayed_init = "TRACY_DELAYED_INIT",
+                manual_lifetime = "TRACY_MANUAL_LIFETIME",
+                fibers = "TRACY_FIBERS",
+                crash_handler = { define = "TRACY_NO_CRASH_HANDLER", invert = true },
+                verb = "TRACY_VERBOSE"
+            }
+
+            for name, def in pairs(defines) do
+                local define, invert
+                if type(def) == "table" then
+                    define = def.define
+                    invert = def.invert
+                else
+                    define = def
+                    invert = false
+                end
+                local value = package:config(name)
+                if value ~= nil then
+                    if invert then
+                        value = not value
+                    end
+                    if value then
+                        package:add("defines", define)
+                    end
+                end
+            end
+        end
     end)
 
     on_test(function (package)
-        assert(package:check_cxxsnippets({test = [[
-            static void test() {
-                FrameMarkStart("Test start");
-                FrameMarkEnd("Test end");
-            }
-        ]]}, {configs = {languages = "c++17"}, includes = {"tracy/Tracy.hpp"}}))
+        if package:config("tracy_enable") then
+            assert(package:check_cxxsnippets({test = [[
+                #include <tracy/Tracy.hpp>
+                void test() {
+                    TracyPlotConfig("PlotConfig", tracy::PlotFormatType::Number, true, true, 0);
+                }
+            ]]}, {configs = {languages = "c++14"}}))
+        end
+        if package:config("fibers") then
+            assert(package:check_cxxsnippets({test = [[
+                #include <tracy/Tracy.hpp>
+                void test() {
+                    TracyFiberEnter("Fiber");
+                }
+            ]]}, {configs = {languages = "c++14"}}))
+        end
     end)