mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-24 21:05:40 +02:00
modules/mpris: fix dependency search
Move dependency discovery to be with other module dependency searches. Also only define the `sdbus` dependency if the module is enabled. For some reason, `mpris.c` was attempted to be compiled even with the option off otherwise. It is also just more consistent.
This commit is contained in:
parent
e68ed8d843
commit
82c564f5ee
2 changed files with 5 additions and 7 deletions
|
@ -77,10 +77,6 @@ backend_wayland = wayland_client.found() and wayland_cursor.found()
|
|||
tllist = dependency('tllist', version: '>=1.0.1', fallback: 'tllist')
|
||||
fcft = dependency('fcft', version: ['>=3.0.0', '<4.0.0'], fallback: 'fcft')
|
||||
|
||||
# DBus dependency. Used by 'modules/mpris'
|
||||
sdbus_library = dependency('libsystemd', 'libelogind', 'basu', required: get_option('plugin-mpris'))
|
||||
sdbus = declare_dependency(compile_args: ['-DHAVE_' + sdbus_library.name().to_upper()], dependencies:[sdbus_library])
|
||||
|
||||
add_project_arguments(
|
||||
cc_flags +
|
||||
['-D_GNU_SOURCE'] +
|
||||
|
|
|
@ -22,8 +22,9 @@ plugin_mem_enabled = get_option('plugin-mem').allowed()
|
|||
mpd = dependency('libmpdclient', required: get_option('plugin-mpd'))
|
||||
plugin_mpd_enabled = mpd.found()
|
||||
|
||||
mpris = sdbus
|
||||
plugin_mpris_enabled = sdbus.found()
|
||||
# DBus dependency. Used by 'mpris'
|
||||
sdbus_library = dependency('libsystemd', 'libelogind', 'basu', required: get_option('plugin-mpris'))
|
||||
plugin_mpris_enabled = sdbus_library.found()
|
||||
|
||||
json_i3 = dependency('json-c', required: get_option('plugin-i3'))
|
||||
plugin_i3_enabled = json_i3.found()
|
||||
|
@ -99,7 +100,8 @@ if plugin_mpd_enabled
|
|||
endif
|
||||
|
||||
if plugin_mpris_enabled
|
||||
mod_data += {'mpris': [[], [mpris]]}
|
||||
sdbus = declare_dependency(compile_args: ['-DHAVE_' + sdbus_library.name().to_upper()], dependencies:[sdbus_library])
|
||||
mod_data += {'mpris': [[], [sdbus]]}
|
||||
endif
|
||||
|
||||
if plugin_i3_enabled
|
||||
|
|
Loading…
Add table
Reference in a new issue