2023-01-13 15:13:56 +00:00
|
|
|
project('gBar',
|
2023-03-03 19:44:51 +00:00
|
|
|
['c', 'cpp'],
|
2023-01-13 15:13:56 +00:00
|
|
|
version: '0.0.1',
|
|
|
|
license: 'MIT',
|
2023-05-03 18:57:24 +00:00
|
|
|
meson_version: '>=0.53.0',
|
2023-03-03 19:44:51 +00:00
|
|
|
default_options: ['cpp_std=c++17',
|
2023-02-24 12:14:00 +00:00
|
|
|
'warning_level=3',
|
|
|
|
'default_library=static',
|
2023-02-27 20:02:43 +00:00
|
|
|
'buildtype=release'],
|
2023-02-24 12:14:00 +00:00
|
|
|
)
|
2023-01-13 15:13:56 +00:00
|
|
|
|
2023-03-03 19:44:51 +00:00
|
|
|
# Wayland protocols
|
|
|
|
wayland_client = dependency('wayland-client')
|
|
|
|
wayland_scanner = find_program('wayland-scanner')
|
|
|
|
|
|
|
|
ext_workspace_src = custom_target('generate-ext-workspace-src',
|
|
|
|
input: ['protocols/ext-workspace-unstable-v1.xml'],
|
|
|
|
output: ['ext-workspace-unstable-v1.c'],
|
|
|
|
command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'])
|
|
|
|
|
|
|
|
ext_workspace_header = custom_target('generate-ext-workspace-header',
|
|
|
|
input: ['protocols/ext-workspace-unstable-v1.xml'],
|
|
|
|
output: ['ext-workspace-unstable-v1.h'],
|
|
|
|
command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'])
|
|
|
|
|
2024-03-17 14:46:45 +00:00
|
|
|
wlr_foreign_toplevel_src = custom_target('generate-wlr-foreign-toplevel-src',
|
|
|
|
input: ['protocols/wlr-foreign-toplevel-management-unstable-v1.xml'],
|
|
|
|
output: ['wlr-foreign-toplevel-management-unstable-v1.c'],
|
|
|
|
command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'])
|
|
|
|
|
|
|
|
wlr_foreign_toplevel_header = custom_target('generate-wlr-foreign-toplevel-header',
|
|
|
|
input: ['protocols/wlr-foreign-toplevel-management-unstable-v1.xml'],
|
|
|
|
output: ['wlr-foreign-toplevel-management-unstable-v1.h'],
|
|
|
|
command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'])
|
2023-01-13 15:13:56 +00:00
|
|
|
gtk = dependency('gtk+-3.0')
|
|
|
|
gtk_layer_shell = dependency('gtk-layer-shell-0')
|
|
|
|
|
2023-05-03 18:57:24 +00:00
|
|
|
pulse = dependency('libpulse')
|
|
|
|
|
2024-03-13 00:21:49 +00:00
|
|
|
sass = dependency('libsass')
|
|
|
|
|
|
|
|
|
2023-01-28 14:07:07 +00:00
|
|
|
headers = [
|
|
|
|
'src/Common.h',
|
2023-02-21 21:20:02 +00:00
|
|
|
'src/Log.h',
|
2023-01-28 14:07:07 +00:00
|
|
|
'src/System.h',
|
|
|
|
'src/PulseAudio.h',
|
|
|
|
'src/Widget.h',
|
|
|
|
'src/Window.h',
|
2023-06-15 11:17:11 +00:00
|
|
|
'src/Wayland.h',
|
2023-02-09 15:13:40 +00:00
|
|
|
'src/Config.h',
|
|
|
|
'src/CSS.h'
|
2023-01-28 14:07:07 +00:00
|
|
|
]
|
|
|
|
|
2023-05-03 18:57:24 +00:00
|
|
|
sources = [
|
|
|
|
ext_workspace_src,
|
|
|
|
ext_workspace_header,
|
2024-03-17 14:46:45 +00:00
|
|
|
wlr_foreign_toplevel_src,
|
|
|
|
wlr_foreign_toplevel_header,
|
2023-05-03 18:57:24 +00:00
|
|
|
'src/Window.cpp',
|
|
|
|
'src/Widget.cpp',
|
2023-06-15 11:17:11 +00:00
|
|
|
'src/Wayland.cpp',
|
2023-05-03 18:57:24 +00:00
|
|
|
'src/System.cpp',
|
|
|
|
'src/Bar.cpp',
|
|
|
|
'src/Workspaces.cpp',
|
|
|
|
'src/AudioFlyin.cpp',
|
|
|
|
'src/BluetoothDevices.cpp',
|
|
|
|
'src/Plugin.cpp',
|
|
|
|
'src/Config.cpp',
|
|
|
|
'src/CSS.cpp',
|
|
|
|
'src/Log.cpp',
|
|
|
|
'src/SNI.cpp',
|
|
|
|
]
|
|
|
|
|
2024-03-13 00:21:49 +00:00
|
|
|
dependencies = [gtk, gtk_layer_shell, pulse, wayland_client, sass]
|
2023-05-03 18:57:24 +00:00
|
|
|
|
2023-01-30 15:57:15 +00:00
|
|
|
if get_option('WithHyprland')
|
2023-03-10 23:24:50 +00:00
|
|
|
add_global_arguments('-DWITH_HYPRLAND', language: 'cpp')
|
2023-03-03 19:44:51 +00:00
|
|
|
headers += 'src/Workspaces.h'
|
|
|
|
endif
|
|
|
|
if get_option('WithWorkspaces')
|
|
|
|
add_global_arguments('-DWITH_WORKSPACES', language: 'cpp')
|
|
|
|
headers += 'src/Workspaces.h'
|
2023-01-13 15:13:56 +00:00
|
|
|
endif
|
2023-01-30 15:57:15 +00:00
|
|
|
if get_option('WithNvidia')
|
|
|
|
add_global_arguments('-DWITH_NVIDIA', language: 'cpp')
|
2023-01-30 15:16:33 +00:00
|
|
|
headers += 'src/NvidiaGPU.h'
|
2023-01-13 15:13:56 +00:00
|
|
|
endif
|
2023-01-30 16:23:28 +00:00
|
|
|
if get_option('WithAMD')
|
|
|
|
add_global_arguments('-DWITH_AMD', language: 'cpp')
|
|
|
|
headers += 'src/AMDGPU.h'
|
|
|
|
endif
|
2023-01-30 15:57:15 +00:00
|
|
|
if get_option('WithBlueZ')
|
|
|
|
add_global_arguments('-DWITH_BLUEZ', language: 'cpp')
|
2023-01-13 15:13:56 +00:00
|
|
|
endif
|
2023-01-30 15:57:15 +00:00
|
|
|
if get_option('WithSys')
|
|
|
|
add_global_arguments('-DWITH_SYS', language: 'cpp')
|
2023-01-13 15:13:56 +00:00
|
|
|
endif
|
2023-05-03 18:57:24 +00:00
|
|
|
if get_option('WithSNI')
|
|
|
|
add_global_arguments('-DWITH_SNI', language: 'cpp')
|
|
|
|
|
|
|
|
# DBus protocols
|
|
|
|
dbus_gen = find_program('gdbus-codegen')
|
|
|
|
sni_item_src = custom_target('generate-sni-item-src',
|
|
|
|
input: ['protocols/sni-item.xml'],
|
|
|
|
output: ['sni-item.c'],
|
|
|
|
command: [dbus_gen, '--c-namespace', 'sni', '--body', '--output', '@OUTPUT@', '@INPUT@'])
|
|
|
|
|
|
|
|
sni_item_header = custom_target('generate-sni-item-header',
|
|
|
|
input: ['protocols/sni-item.xml'],
|
|
|
|
output: ['sni-item.h'],
|
|
|
|
command: [dbus_gen, '--c-namespace', 'sni', '--header', '--output', '@OUTPUT@', '@INPUT@'])
|
|
|
|
|
|
|
|
sni_watcher_src = custom_target('generate-sni-watcher-src',
|
|
|
|
input: ['protocols/sni-watcher.xml'],
|
|
|
|
output: ['sni-watcher.c'],
|
|
|
|
command: [dbus_gen, '--c-namespace', 'sni', '--body', '--output', '@OUTPUT@', '@INPUT@'])
|
|
|
|
|
|
|
|
sni_watcher_header = custom_target('generate-sni-watcher-header',
|
|
|
|
input: ['protocols/sni-watcher.xml'],
|
|
|
|
output: ['sni-watcher.h'],
|
|
|
|
command: [dbus_gen, '--c-namespace', 'sni', '--header', '--output', '@OUTPUT@', '@INPUT@'])
|
|
|
|
libdbusmenu = dependency('dbusmenu-gtk3-0.4')
|
|
|
|
|
|
|
|
sources += sni_item_src
|
|
|
|
sources += sni_item_header
|
|
|
|
sources += sni_watcher_src
|
|
|
|
sources += sni_watcher_header
|
|
|
|
|
|
|
|
dependencies += libdbusmenu
|
|
|
|
endif
|
2023-01-13 15:13:56 +00:00
|
|
|
|
2023-02-21 21:20:02 +00:00
|
|
|
add_global_arguments('-DUSE_LOGFILE', language: 'cpp')
|
|
|
|
|
2023-03-03 19:44:51 +00:00
|
|
|
libgBar = library('gBar',
|
2023-05-03 18:57:24 +00:00
|
|
|
sources,
|
|
|
|
dependencies: dependencies,
|
2023-01-28 14:07:07 +00:00
|
|
|
install: true)
|
|
|
|
|
|
|
|
pkg = import('pkgconfig')
|
|
|
|
pkg.generate(libgBar)
|
|
|
|
|
|
|
|
executable(
|
|
|
|
'gBar',
|
2023-03-03 19:44:51 +00:00
|
|
|
['src/gBar.cpp'],
|
2023-01-28 14:07:07 +00:00
|
|
|
dependencies: [gtk],
|
|
|
|
link_with: libgBar,
|
2023-02-21 09:05:13 +00:00
|
|
|
install_rpath: '$ORIGIN/',
|
2023-01-13 15:13:56 +00:00
|
|
|
install: true
|
|
|
|
)
|
2023-01-28 14:07:07 +00:00
|
|
|
|
|
|
|
install_headers(
|
|
|
|
headers,
|
|
|
|
subdir: 'gBar'
|
|
|
|
)
|
2023-01-28 16:29:10 +00:00
|
|
|
|
|
|
|
install_data(
|
|
|
|
['css/style.css',
|
|
|
|
'css/style.scss'],
|
|
|
|
install_dir: get_option('datadir') / 'gBar'
|
|
|
|
)
|