Commit 4d8b4565 authored by Christian Kellner's avatar Christian Kellner

build: support for profiling (gprof)

Compile and link with '-pg'.
parent ff57e749
......@@ -109,6 +109,16 @@ if systemd.found()
unitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir')
profiling = get_option('profiling')
if profiling
args = ['-pg']
profiling = compiler.has_multi_arguments(args)
if profiling
add_project_arguments(args, language: 'c')
add_project_link_arguments(args, language: 'c')
version_split = meson.project_version().split('.')
version_major = version_split[0]
version_minor = version_split[1]
......@@ -521,6 +531,7 @@ msg = ['',
'build manpage: @0@'.format(build_man),
'install tests: @0@'.format(install_tests),
'profiling (gprof): @0@'.format(profiling),
message('\n '.join(msg))
......@@ -4,4 +4,5 @@ option('db-name', type: 'string', value: 'boltd', description: 'Name for the dev
option('install-tests', type: 'boolean', value: 'false', description: 'Install the tests')
option('man', type: 'combo', choices: ['auto', 'true', 'false'], value: 'auto', description: 'Build man pages')
option('privileged-group', type: 'string', value: 'wheel', description: 'Name of privileged group')
option('profiling', type: 'boolean', value: 'false', description: 'Build with profiling support')
option('systemd', type: 'boolean', value: 'true', description: 'DEPRECATED')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment