build: require gio-unix-2.0 unconditionally

We already use it without checking (`<gio/gdesktopappinfo.h>` in
wlr/taskbar), it's a transitive dependency of GTK and it's always
available on Unix platforms.
This commit is contained in:
Aleksei Bavshin 2024-02-16 23:30:00 -08:00
parent 104accdc34
commit 72406fa3f2
No known key found for this signature in database
GPG Key ID: 4F071603387A382A
3 changed files with 10 additions and 17 deletions

View File

@ -80,8 +80,8 @@
#ifdef HAVE_LIBSNDIO
#include "modules/sndio.hpp"
#endif
#ifdef HAVE_GIO_UNIX
#include "modules/bluetooth.hpp"
#ifdef HAVE_LOGIND_INHIBITOR
#include "modules/inhibitor.hpp"
#endif
#ifdef HAVE_LIBJACK

View File

@ -75,10 +75,7 @@ wayland_cursor = dependency('wayland-cursor')
wayland_protos = dependency('wayland-protocols')
gtkmm = dependency('gtkmm-3.0', version : ['>=3.22.0'])
dbusmenu_gtk = dependency('dbusmenu-gtk3-0.4', required: get_option('dbusmenu-gtk'))
giounix = dependency('gio-unix-2.0', required: (get_option('dbusmenu-gtk').enabled() or
get_option('logind').enabled() or
get_option('upower_glib').enabled() or
get_option('mpris').enabled()))
giounix = dependency('gio-unix-2.0')
jsoncpp = dependency('jsoncpp', version : ['>=1.9.2'], fallback : ['jsoncpp', 'jsoncpp_dep'])
sigcpp = dependency('sigc++-2.0')
libinotify = dependency('libinotify', required: false)
@ -165,6 +162,7 @@ src_files = files(
'src/ALabel.cpp',
'src/AIconLabel.cpp',
'src/AAppIconLabel.cpp',
'src/modules/bluetooth.cpp',
'src/modules/custom.cpp',
'src/modules/disk.cpp',
'src/modules/idle_inhibitor.cpp',
@ -272,12 +270,13 @@ if libnl.found() and libnlgen.found()
src_files += 'src/modules/network.cpp'
endif
if (giounix.found() and not get_option('logind').disabled())
add_project_arguments('-DHAVE_GAMEMODE', language: 'cpp')
if not get_option('logind').disabled()
add_project_arguments('-DHAVE_GAMEMODE', '-DHAVE_LOGIND_INHIBITOR', language: 'cpp')
src_files += 'src/modules/gamemode.cpp'
src_files += 'src/modules/inhibitor.cpp'
endif
if (upower_glib.found() and giounix.found() and not get_option('logind').disabled())
if (upower_glib.found() and not get_option('logind').disabled())
add_project_arguments('-DHAVE_UPOWER', language: 'cpp')
src_files += 'src/modules/upower/upower.cpp'
src_files += 'src/modules/upower/upower_tooltip.cpp'
@ -291,7 +290,7 @@ if (pipewire.found())
src_files += 'src/util/pipewire_backend.cpp'
endif
if (playerctl.found() and giounix.found() and not get_option('logind').disabled())
if (playerctl.found() and not get_option('logind').disabled())
add_project_arguments('-DHAVE_MPRIS', language: 'cpp')
src_files += 'src/modules/mpris/mpris.cpp'
endif
@ -351,12 +350,6 @@ if libsndio.found()
src_files += 'src/modules/sndio.cpp'
endif
if (giounix.found() and not get_option('logind').disabled())
add_project_arguments('-DHAVE_GIO_UNIX', language: 'cpp')
src_files += 'src/modules/inhibitor.cpp'
src_files += 'src/modules/bluetooth.cpp'
endif
if get_option('rfkill').enabled() and is_linux
add_project_arguments('-DWANT_RFKILL', language: 'cpp')
src_files += files(
@ -500,7 +493,7 @@ if scdoc.found()
'waybar-dwl-tags.5.scd',
]
if (giounix.found() and not get_option('logind').disabled())
if not get_option('logind').disabled()
man_files += 'waybar-inhibitor.5.scd'
endif

View File

@ -178,10 +178,10 @@ waybar::AModule* waybar::Factory::makeModule(const std::string& name,
return new waybar::modules::Sndio(id, config_[name]);
}
#endif
#ifdef HAVE_GIO_UNIX
if (ref == "bluetooth") {
return new waybar::modules::Bluetooth(id, config_[name]);
}
#ifdef HAVE_LOGIND_INHIBITOR
if (ref == "inhibitor") {
return new waybar::modules::Inhibitor(id, bar_, config_[name]);
}