summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorChristian Hergert <chergert@redhat.com>2020-08-21 13:49:14 -0700
committerChristian Hergert <chergert@redhat.com>2020-08-21 13:51:52 -0700
commit5a5b30681efe2f74d676911444967f7e73a09c51 (patch)
tree43f0009ec3c62f7571f7991e425d5c2697e8203f /meson.build
parent7039f313910fc00c1937d09950fac17f516b0a96 (diff)
downloadgtk+-5a5b30681efe2f74d676911444967f7e73a09c51.tar.gz
testsuite: use SysprofProfiler for profiling
Instead of using sysprof-cli to profile subprocesses, this uses libsysprof's SysprofProfiler directly so that we can avoid an indirect subprocess as well as disabling the polkit nag. To do this, we have to link against libsysprof instead of libsysprof-capture. This is limited to the -Dbuild-tests=true and -Dprofiler=true case.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build38
1 files changed, 26 insertions, 12 deletions
diff --git a/meson.build b/meson.build
index 7b32667bf9..5884b259e9 100644
--- a/meson.build
+++ b/meson.build
@@ -703,20 +703,34 @@ endif
profiler_enabled = get_option('profiler')
if profiler_enabled
- # libsysprof-capture support
- profiler_dep = dependency('sysprof-capture-4',
+ # Depend on libsysprof-capture if we only need the capture format.
+ # For -Dbuild-tests=true, we need SysprofProfiler to profile processes
+ # which requires sysprof-4 instead of sysprof-capture-4.
+
+ profiler_options = [
+ 'enable_examples=false',
+ 'enable_gtk=false',
+ 'enable_tests=false',
+ 'enable_tools=false',
+ 'with_sysprofd=none',
+ 'help=false',
+ ]
+
+ if get_option('build-tests')
+ profiler_dep_name = 'sysprof-4'
+ profiler_fallback = 'libsysprof_dep'
+ else
+ profiler_dep_name = 'sysprof-capture-4'
+ profiler_fallback = 'libsysprof_capture_dep'
+ profiler_options += ['libsysprof=false']
+ endif
+
+ profiler_dep = dependency(profiler_dep_name,
required: true,
- default_options: [
- 'enable_examples=false',
- 'enable_gtk=false',
- 'enable_tests=false',
- 'enable_tools=false',
- 'libsysprof=false',
- 'with_sysprofd=none',
- 'help=false',
- ],
- fallback: ['sysprof', 'libsysprof_capture_dep'],
+ default_options: profiler_options,
+ fallback: ['sysprof', profiler_fallback],
)
+
if profiler_dep.found()
cdata.set('HAVE_SYSPROF', profiler_dep.found())
else