build: Move Meson dependency() calls to where they’re used

This avoids making the project depend on all its dependencies, some of
which are optional, when being built as a Meson subproject.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall
2020-07-02 20:00:10 +01:00
parent 760805c8b9
commit 3c7b76c6ba
7 changed files with 24 additions and 38 deletions

View File

@ -7,6 +7,7 @@ tools_cflags = [ '-DSYSPROF_COMPILATION ']
if get_option('libsysprof') and host_machine.system() == 'linux'
polkit_agent_dep = dependency('polkit-agent-1')
polkit_dep = dependency('polkit-gobject-1', version: polkit_req_version, required: false)
sysprof_cli = executable('sysprof-cli', 'sysprof-cli.c',
dependencies: tools_deps + [libsysprof_dep, polkit_dep, polkit_agent_dep],
c_args: tools_cflags,
@ -29,7 +30,7 @@ sysprof_dump = executable('sysprof-dump', 'sysprof-dump.c',
sysprof_profiler_ctl = executable('sysprof-profiler-ctl',
[ 'sysprof-profiler-ctl.c', ipc_profiler_src ],
dependencies: [ tools_deps, gio_unix_dep ],
dependencies: [ tools_deps, dependency('gio-unix-2.0', version: glib_req_version) ],
c_args: tools_cflags,
install: false,
)