forked from wolfpld/tracy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
190 lines (153 loc) · 5.33 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
project('tracy', ['cpp'])
if get_option('tracy_enable')
add_project_arguments('-DTRACY_ENABLE', language : 'cpp')
endif
if get_option('tracy_on_demand')
add_project_arguments('-DTRACY_ON_DEMAND', language : 'cpp')
endif
if get_option('tracy_callstack')
add_project_arguments('-DTRACY_CALLSTACK', language : 'cpp')
endif
if get_option('tracy_no_callstack')
add_project_arguments('-DTRACY_NO_CALLSTACK', language : 'cpp')
endif
if get_option('tracy_no_callstack_inlines')
add_project_arguments('-DTRACY_NO_CALLSTACK_INLINES', language : 'cpp')
endif
if get_option('tracy_only_localhost')
add_project_arguments('-DTRACY_ONLY_LOCALHOST', language : 'cpp')
endif
if get_option('tracy_no_broadcast')
add_project_arguments('-DTRACY_NO_BROADCAST', language : 'cpp')
endif
if get_option('tracy_only_ipv4')
add_project_arguments('-DTRACY_ONLY_IPV4', language : 'cpp')
endif
if get_option('tracy_no_code_transfer')
add_project_arguments('-DTRACY_NO_CODE_TRANSFER', language : 'cpp')
endif
if get_option('tracy_no_context_switch')
add_project_arguments('-DTRACY_NO_CONTEXT_SWITCH', language : 'cpp')
endif
if get_option('tracy_no_exit')
add_project_arguments('-DTRACY_NO_EXIT', language : 'cpp')
endif
if get_option('tracy_no_sampling')
add_project_arguments('-DTRACY_NO_SAMPLING', language : 'cpp')
endif
if get_option('tracy_no_verify')
add_project_arguments('-DTRACY_NO_VERIFY', language : 'cpp')
endif
if get_option('tracy_no_vsync_capture')
add_project_arguments('-DTRACY_NO_VSYNC_CAPTURE', language : 'cpp')
endif
if get_option('tracy_no_frame_image')
add_project_arguments('-DTRACY_NO_FRAME_IMAGE', language : 'cpp')
endif
if get_option('tracy_no_system_tracing')
add_project_arguments('-DTRACY_NO_SYSTEM_TRACING', language : 'cpp')
endif
if get_option('tracy_delayed_init')
add_project_arguments('-DTRACY_DELAYED_INIT', language : 'cpp')
endif
if get_option('tracy_manual_lifetime')
add_project_arguments('-DTRACY_MANUAL_LIFETIME', language : 'cpp')
endif
if get_option('tracy_fibers')
add_project_arguments('-DTRACY_FIBERS', language : 'cpp')
endif
if get_option('tracy_timer_fallback')
add_project_arguments('-DTRACY_TIMER_FALLBACK', language : 'cpp')
endif
tracy_shared_libs = get_option('tracy_shared_libs')
if tracy_shared_libs
add_project_arguments('-DTRACY_EXPORTS', language : 'cpp')
endif
if get_option('tracy_no_crash_handler')
add_project_arguments('-DTRACY_NO_CRASH_HANDLER', language : 'cpp')
endif
threads_dep = dependency('threads')
includes = [
'public/tracy/TracyC.h',
'public/tracy/Tracy.hpp',
'public/tracy/TracyD3D11.hpp',
'public/tracy/TracyD3D12.hpp',
'public/tracy/TracyLua.hpp',
'public/tracy/TracyOpenCL.hpp',
'public/tracy/TracyOpenGL.hpp',
'public/tracy/TracyVulkan.hpp'
]
client_includes = [
'public/client/tracy_concurrentqueue.h',
'public/client/tracy_rpmalloc.hpp',
'public/client/tracy_SPSCQueue.h',
'public/client/TracyArmCpuTable.hpp',
'public/client/TracyCallstack.h',
'public/client/TracyCallstack.hpp',
'public/client/TracyDebug.hpp',
'public/client/TracyDxt1.hpp',
'public/client/TracyFastVector.hpp',
'public/client/TracyLock.hpp',
'public/client/TracyProfiler.hpp',
'public/client/TracyRingBuffer.hpp',
'public/client/TracyScoped.hpp',
'public/client/TracyStringHelpers.hpp',
'public/client/TracySysTime.hpp',
'public/client/TracySysTrace.hpp',
'public/client/TracyThread.hpp'
]
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',
'public/common/TracyForceInline.hpp',
'public/common/TracyMutex.hpp',
'public/common/TracyProtocol.hpp',
'public/common/TracyQueue.hpp',
'public/common/TracySocket.hpp',
'public/common/TracyStackFrames.hpp',
'public/common/TracySystem.hpp',
'public/common/TracyUwp.hpp',
'public/common/TracyYield.hpp'
]
tracy_header_files = common_includes + client_includes + includes
tracy_src = [
'public/TracyClient.cpp'
]
tracy_public_include_dirs = include_directories('public')
compiler = meson.get_compiler('cpp')
override_options = []
if compiler.get_id() != 'msvc'
override_options += 'cpp_std=c++11'
endif
if tracy_shared_libs
tracy = shared_library('tracy', tracy_src, tracy_header_files,
dependencies : [ threads_dep ],
include_directories : tracy_public_include_dirs,
override_options : override_options,
install : true)
else
tracy = static_library('tracy', tracy_src, tracy_header_files,
dependencies : [ threads_dep ],
include_directories : tracy_public_include_dirs,
override_options : override_options,
install : true)
endif
install_headers(includes)
install_headers(common_includes, subdir : 'common')
install_headers(client_includes, subdir : 'client')
tracy_dep_compile_args = []
if tracy_shared_libs
tracy_dep_compile_args += [ '-DTRACY_IMPORTS' ]
endif
tracy_dep = declare_dependency(
compile_args : tracy_dep_compile_args,
link_with : tracy,
include_directories : tracy_public_include_dirs)
tracy_dep_dynamic = declare_dependency(
include_directories : tracy_public_include_dirs)
meson.override_dependency('tracy', tracy_dep)