1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Merge 8160e959ad4c2cf01a53ed2fc9edf9d6e1fb596b into 17d3ac0141e61d0477ba16632bae9809f2d85fc9

This commit is contained in:
Tyler 2022-10-08 21:47:43 +02:00 committed by GitHub
commit a194efe59f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 131 additions and 2 deletions

4
.gitignore vendored
View File

@ -40,3 +40,7 @@ extra/vswhere.exe
extra/tracy-build
/.cache
compile_commands.json
subprojects/*
!subprojects/imgui.wrap
!subprojects/zstd.wrap

5
imgui/meson.build Normal file
View File

@ -0,0 +1,5 @@
imgui_sources = files('imgui.cpp', 'imgui_draw.cpp', 'imgui_tables.cpp', 'imgui_widgets.cpp')
imgui_inc = include_directories('.')
imgui_lib = library('imgui_lib', imgui_sources, include_directories: imgui_inc)
imgui_dep = declare_dependency(include_directories: imgui_inc, link_with: imgui_lib)

View File

@ -1,4 +1,4 @@
project('tracy', ['cpp'])
project('tracy', ['cpp', 'c'], default_options: 'cpp_std=c++17')
if get_option('tracy_enable')
add_project_arguments('-DTRACY_ENABLE', language : 'cpp')
@ -89,7 +89,19 @@ if get_option('tracy_no_crash_handler')
add_project_arguments('-DTRACY_NO_CRASH_HANDLER', language : 'cpp')
endif
if get_option('tracy_use_wayland')
add_project_arguments('-DDISPLAY_SERVER_WAYLAND', language: 'cpp')
add_project_arguments('-DGLFW_EXPOSE_NATIVE_WAYLAND', language: 'cpp')
else
add_project_arguments('-DDISPLAY_SERVER_X11', language: 'cpp')
endif
if get_option('tracy_fileselector') == 'none'
add_project_arguments('-DTRACY_NO_FILESELECTOR', language: 'cpp')
endif
threads_dep = dependency('threads')
zstd = dependency('libzstd')
includes = [
'public/tracy/TracyC.h',
@ -126,7 +138,6 @@ common_includes = [
'public/common/tracy_lz4.hpp',
'public/common/tracy_lz4hc.hpp',
'public/common/TracyAlign.hpp',
'public/common/TracyAlign.hpp',
'public/common/TracyAlloc.hpp',
'public/common/TracyApi.h',
'public/common/TracyColor.hpp',
@ -188,3 +199,7 @@ tracy_dep_dynamic = declare_dependency(
include_directories : tracy_public_include_dirs)
meson.override_dependency('tracy', tracy_dep)
subdir('imgui')
subdir('server')
subdir('profiler')

View File

@ -20,3 +20,6 @@ option('tracy_manual_lifetime', type : 'boolean', value : false, description : '
option('tracy_fibers', type : 'boolean', value : false, description : 'Enable fibers support')
option('tracy_shared_libs', type : 'boolean', value : false, description : 'Builds Tracy as a shared object')
option('tracy_no_crash_handler', type : 'boolean', value : false, description : 'Disable crash handling')
option('tracy_use_wayland', type : 'boolean', value : false, description : 'Profiler: Set the Display Server on linux to wayland')
option('tracy_fileselector', type : 'combo', choices : ['none', 'gtk'], value : 'none', description : 'Profiler: Choose fileselector')

29
profiler/meson.build Normal file
View File

@ -0,0 +1,29 @@
profiler_sources = files(
'src/main.cpp',
'src/BackendGlfw.cpp',
'src/ConnectionHistory.cpp',
'src/Filters.cpp',
'src/Fonts.cpp',
'src/HttpRequest.cpp',
'src/ImGuiContext.cpp',
'src/ResolvService.cpp',
'src/RunQueue.cpp',
'src/WindowPosition.cpp',
'src/imgui/imgui_impl_glfw.cpp',
'src/imgui/imgui_impl_opengl3.cpp')
glfw = dependency('glfw3')
deps = [glfw, threads_dep, server_dep, zstd]
if get_option('tracy_fileselector') == 'gtk'
profiler_sources += files('../nfd/nfd_gtk.cpp')
deps += dependency('gtk+-3.0')
endif
if get_option('tracy_use_wayland')
deps += dependency('wayland-client')
endif
profiler_inc = include_directories('src', 'src/imgui')
executable('profiler', profiler_sources, include_directories: profiler_inc, dependencies: deps)

61
server/meson.build Normal file
View File

@ -0,0 +1,61 @@
server_sources = files(
'../public/common/tracy_lz4.cpp',
'../public/common/tracy_lz4hc.cpp',
'../public/common/TracySocket.cpp',
'../public/common/TracyStackFrames.cpp',
'../public/common/TracySystem.cpp',
'TracyBadVersion.cpp',
'TracyColor.cpp',
# 'TracyEventDebug.cpp',
'TracyFilesystem.cpp',
'TracyImGui.cpp',
'TracyMemory.cpp',
'TracyMicroArchitecture.cpp',
'TracyMmap.cpp',
'TracyMouse.cpp',
'TracyPrint.cpp',
'TracyProtoHistory.cpp',
'TracySourceContents.cpp',
'TracySourceTokenizer.cpp',
'TracySourceView.cpp',
'TracyStorage.cpp',
'TracyTaskDispatch.cpp',
'TracyTexture.cpp',
'TracyTextureCompression.cpp',
'TracyThreadCompress.cpp',
'TracyUserData.cpp',
'TracyView_Annotations.cpp',
'TracyView_Callstack.cpp',
'TracyView_Compare.cpp',
'TracyView_ConnectionState.cpp',
'TracyView_ContextSwitch.cpp',
'TracyView_CpuData.cpp',
'TracyView_FindZone.cpp',
'TracyView_FrameOverview.cpp',
'TracyView_FrameTimeline.cpp',
'TracyView_FrameTree.cpp',
'TracyView_Locks.cpp',
'TracyView_Memory.cpp',
'TracyView_Messages.cpp',
'TracyView_Navigation.cpp',
'TracyView_NotificationArea.cpp',
'TracyView_Options.cpp',
'TracyView_Playback.cpp',
'TracyView_Plots.cpp',
'TracyView_Ranges.cpp',
'TracyView_Samples.cpp',
'TracyView_Statistics.cpp',
'TracyView_Timeline.cpp',
'TracyView_TraceInfo.cpp',
'TracyView_Utility.cpp',
'TracyView_ZoneInfo.cpp',
'TracyView_ZoneTimeline.cpp',
'TracyView.cpp',
'TracyWeb.cpp',
'TracyWorker.cpp')
capstone = dependency('capstone')
deps = [imgui_dep, capstone]
server_lib = static_library('tracy_server', server_sources, dependencies: deps, cpp_args: '-UTRACY_ENABLE')
server_dep = declare_dependency(dependencies: deps, link_with: server_lib)

12
subprojects/zstd.wrap Normal file
View File

@ -0,0 +1,12 @@
[wrap-file]
directory = zstd-1.4.5
source_url = https://github.com/facebook/zstd/releases/download/v1.4.5/zstd-1.4.5.tar.gz
source_filename = zstd-1.4.5.tar.gz
source_hash = 98e91c7c6bf162bf90e4e70fdbc41a8188b9fa8de5ad840c401198014406ce9e
patch_url = https://wrapdb.mesonbuild.com/v2/zstd_1.4.5-1/get_patch
patch_filename = zstd-1.4.5-1-wrap.zip
patch_hash = fd9cb7b9c8f7092ef1597ff68f170beef65fcf33e575a621955cf405a41db1cc
[provide]
libzstd = libzstd_dep